Previous Page | Next Page

Formats

PDw.d Format



Writes data in packed decimal format.
Category: Numeric
Alignment: left
See: PDw.d Format under Windows UNIX OpenVMS z/OS

Syntax
Syntax Description
Details
Comparisons
Examples

Syntax

PDw.d

Syntax Description

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.)

Default: 1
Range: 1-16
d

specifies to multiply the number by 10d. This argument is optional.

Default: 0
Range: 0-31

Details

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.


Comparisons

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


Examples

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.

Previous Page | Next Page | Top of Page