Chapter Contents

Previous

Next
PD

PD



Reads data stored in IBM packed decimal format into a floating-point number

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


Syntax
Details
See Also

Syntax

PDw.d

w
specifies the field width of the input value.

d
specifies a divisor for the input value. If the informat includes a d value, the input value is divided by 10d.


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 from 1031 -1 to 10-31 +1. The sign is written in the rightmost nibble, with a 'C'x indicating a positive value and a 'D'x indicating a negative value. 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. The following table shows several examples of how data is read using the PDw.d informat.

Data Pattern Read Actual Numeric Value Informat Resulting Numeric Value
'01234C'x 1234 pd3. 1234
'01234D'x -1234 pd3. -1234
'0001234C'x 1234 pd4. 1234
'0012340C'x 12340 pd4.1 1234
'0123400C'x 123400 pd4.2 1234


See Also


Chapter Contents

Previous

Next

Top of Page

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