Writes data in packed decimal format.
-
w
-
specifies the width of the output field.
The w value specifies the number of bytes, not
the number of digits. (In packed decimal data, each byte contains two digits.)
-
d
-
specifies to multiply the number by 10d. This argument is optional.
Different operating environments store
packed decimal values in different ways. However, the PDw.d format writes packed decimal values with consistent results
if the values are created in the same type of operating environment
that you use to run SAS.
The PDw.d format writes missing numerical
data as -0. When the PDw.d informat reads
a -0, it stores it as 0.
The following table compares packed decimal
notation in several programming languages:
Language |
Notation |
SAS |
PD4. |
COBOL |
COMP-3 PIC S9(7) |
IBM 370 assembler |
PL4 |
PL/I |
FIXED DEC |
y=put(x,pd4.);
put y $hex8.;
Value of x |
Results* |
|
----+----1
|
128
|
00000128
|
*
The result is a hexadecimal representation of a binary
number written in packed decimal format. Each byte occupies one column of
the output field. |
Copyright © 2011 by SAS Institute Inc., Cary, NC, USA. All rights reserved.