ZDw.d Format

Writes numeric data in zoned decimal format.

Category: Numeric
Alignment: Left
Interaction: When the DECIMALCONV= system option is set to STDIEEE, the output that is written using this format might differ slightly from previous releases. For more information, see DECIMALCONV= System Option in SAS System Options: Reference.
See: ZDw.d Format: UNIX in SAS Companion for UNIX Environments
ZDw.d Format: Windows in SAS Companion for Windows
ZDw.d Format: z/OS in SAS Companion for z/OS

Syntax

ZDw.d

Syntax Description

w

specifies the width of the output field.

Default 1
Range 1–32

d

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

Default 0
Range 0–31

Details

The zoned decimal format is similar to standard numeric format in that every digit requires one byte. However, the value's sign is in the last byte, along with the last digit.
Note: Different operating environments store zoned decimal values in different ways. However, the ZDw.d format writes zoned decimal values with consistent results if the values are created in the same type of operating environment that you use to run SAS.

Comparisons

The following table compares the zoned decimal format with notation in several programming languages:
Language
Zoned Decimal Notation
SAS
ZD3.
PL/I
PICTURE '99T'
COBOL
DISPLAY PIC S 999
IBM 370 assembler
ZL3

Example

y=put(x,zd4.);
put y $hex8.;
Value of x
Result 1
120
F0F1F2C0
1The result is a hexadecimal representation of a binary number in zoned decimal format on an IBM mainframe computer. Each byte occupies one column of the output field.