Chapter Contents

Previous

Next
PDw.d

PDw.d



Writes data in packed decimal format

Category: Numeric
Alignment: left


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
optionally specifies to multiply the number by 10d.


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 kind of operating environment that you use to run SAS.


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

Values Results*

----+----1
128
0000128
*The result is a hexadecimal representation of a binary number written in packed decimal format. Each byte occupies one column of the output field.


Chapter Contents

Previous

Next

Top of Page

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