ZDw.d Format: z/OS

Writes zoned-decimal data.
Category: Numeric
Alignment: left
Default: 1
Ranges: 1-32 bytes, 0-32
z/OS specifics: IBM zoned decimal format
See: ZDw.d Format in SAS Formats and Informats: Reference

Details

Like standard format, zoned decimal digits are represented as EBCDIC characters. Each digit requires one byte. The rightmost byte represents both the least significant digit and the sign of the number. Digits to the left of the least significant digit are written as the EBCDIC characters 0 through 9. The character that is written for the least significant digit depends on the sign of the number. Negative numbers are represented as the EBCDIC printable hexadecimal characters D0 through D9 in the least significant digit position, and positive numbers are represented as hexadecimal C0 through C9. If the format includes a d value, the number is multiplied by 10d.
If an overflow occurs, the value that is written is the largest value that fits into the output field; the value will be positive, negative, or unsigned, as appropriate.
The following table contains examples that illustrate the use of the zoned decimal format:
Value
Format
Results (Hexadecimal)
Notes
1234
zd8.
F0F0F0F0F1F2F3C4
123
zd8.1
F0F0F0F0F1F2F3C0
a d value of 1 causes the number to be multiplied by 101
123
zd8.2
F0F0F0F1F2F3F0C0
a d value of 2 causes the number to be multiplied by 102
-123
zd8.
F0F0F0F0F0F1F2D3
0.000123
zd8.6
F0F0F0F0F0F1F2C3
a d value of 6 causes the number to be multiplied by 106
0.00123
zd8.6
F0F0F0F0F1F2F3C0
a d value of 6 causes the number to be multiplied by 106
1E-6
zd8.6
F0F0F0F0F0F0F0C1
a d value of 6 causes the number to be multiplied by 106
Note: In these examples, the Value column represents the value of the data, and the Results column shows a hexadecimal representation of the bit pattern that is written by the corresponding format. (You cannot view this data in a text editor unless you view it in hexadecimal representation.) For a table of commonly used EBCDIC characters, see EBCDIC Code: Commonly Used Characters.

See Also

Formats
S370FZDLw.d Format in SAS Formats and Informats: Reference
S370FZDSw.d Format in SAS Formats and Informats: Reference
S370FZDTw.d Format in SAS Formats and Informats: Reference
S370FZDUw.d Format in SAS Formats and Informats: Reference