![]() Chapter Contents |
![]() Previous |
![]() Next |
| PDw.d |
| Numeric | |
| Width range: | 1-16 bytes |
| Default width: | 1 |
| Decimal range: | 0-31 |
| OS/390 specifics: | IBM packed decimal format |
| Details | |
| See Also |
| Details |
In packed decimal format, each byte except for the last byte represents two decimal digits. (The last byte represents one digit and the sign.) An IBM packed decimal number consists of a sign and up to 31 digits, thus giving a range from -1031 + 1 to 1031 - 1. The sign is written in the rightmost nibble. (A nibble is 4 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.
Here are several examples of how data is read using the PDw.d informat:
| Data Line (Hex) | Informat | Value | Notes | |
|---|---|---|---|---|
| 01234D | pd3. | -1234 | ||
| 0123400C | pd4.2 | 1234 | the d value of 2 causes the number to be divided by 102 | |
Note: In these examples, Data Line (Hex)
represents the bit pattern stored, which is the value you see if you view
it in a text editor that displays values in hexadecimal representation. Value
is the number that is used by SAS after the data pattern has been read using
the corresponding informat. ![[cautionend]](../common/images/cautend.gif)
| See Also |
![]() Chapter Contents |
![]() Previous |
![]() Next |
![]() Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.