PDw.d Format: z/OS

Writes values in IBM packed decimal format.
Category: Numeric
Alignment: left
Default: 1
Ranges: 1-16 bytes, 0-31
z/OS specifics: IBM packed decimal format
See: PDw.d Format in SAS Formats and Informats: Reference

Details

In packed decimal format, each byte represents two decimal digits. An IBM packed decimal number consists of a sign and up to 31 digits, thus giving a range of 1031 −1 to -1031 + 1. The sign is written in the rightmost nibble. (A nibble is four bits or half a byte.) A hexadecimal C indicates a plus sign, and a hexadecimal D indicates 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 can be used in the digit positions.
If an overflow occurs, the value that is written is the largest value that fits into the output field; the value will be positive, negative, or unsigned, as appropriate.
The following table contains examples that illustrate packed decimal format:
Value
Format
Results (Hexadecimal)
Notes
-1234
pd3.
01234D
1234
pd2.
999C
overflow occurred
1234
pd4.
0001234C
1234
pd4.2
0123400C
a d value of 2 causes the number to be multiplied by 102
Note: In these examples, the Value column represents the value of the data, and the Results column shows a hexadecimal representation of the bit pattern written by the corresponding format. (You cannot view this data in a text editor, unless you can view it in hexadecimal representation.)
The PDw.d format writes missing numerical data as -0. When the PDw.d informat reads -0, the informat stores -0 as 0.

See Also

Formats
S370FPDw.d Format in SAS Formats and Informats: Reference
Informats
PDw.d Format in SAS Formats and Informats: Reference