Chapter Contents

Previous

Next
PD

PD



Writes values in IBM packed decimal format

Numeric
Width range: 1- 16
Default width: 1
Decimal range: 0- 10
Alignment: left
CMS specifics: IBM packed decimal format


Syntax
Details
See Also

Syntax

PDw.d

w
specifies the field width of the output value, in bytes.

d
specifies a multiplier for the output value. If the format includes a d value, the output value is multiplied by 10d .


Details

An IBM packed decimal number consists of a sign and up to 31 digits, thus giving a range from 1031 -1 to 10-31 +1. The sign is written in the rightmost nibble, with a 'C'x indicating a plus sign and a 'D'x indicating a minus sign. The rest of the nibbles to the left of the sign nibble represent decimal digits. The hexadecimal values of these digit nibbles correspond to decimal values; therefore, only values between '0'x and '9'x are displayed in the digit positions. The following table shows several examples of the PD format.

Decimal Number Format Packed Decimal Data Pattern Written
1234 pd3. '01234C'x
-1234 pd3. '01234D'x
1234 pd2. '999C'x
1234 pd4. '0001234C'x
1234 pd4.1 '0012340C'x
1234 pd4.2 '0123400C'x


See Also


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.