ZDw.d Informat

Reads zoned decimal data.

Category: Numeric
Interaction: List input is incompatible with binary input when this informat is specified in an INFORMAT= statement or an ATTRIB= statement using the INFORMAT= argument. SAS issues a warning and uses formatted input to read the data.
See: ZDw.d Informat: UNIX in SAS Companion for UNIX Environments
ZDw.d Informat: 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 input field.

Default 1
Range 1–32

d

specifies the power of 10 by which to divide the value. This argument is optional.

Range 1–31

Details

The ZDw.d informat reads zoned decimal data in which every digit requires one byte and in which the last byte contains the value's sign along with the last digit.
Note: Different operating environments store zoned decimal values in different ways. However, ZDw.d reads zoned decimal values with consistent results if the values are created in the same type of operating environment that you use to run SAS.
You can enter positive values in zoned decimal format from a personal computer. Some keying devices enable you to enter negative values by overstriking the last digit with a minus sign.

Comparisons

  • Like the w.d informat, the ZDw.d informat reads data in which every digit requires one byte. Use ZDVw.d or ZDw.d to read zoned decimal data in which the last byte contains the last digit and the sign.
  • The ZDw.d informat functions like the ZDVw.d informat with one exception: ZDVw.d validates the input string and disallows invalid data.
  • The following table compares the zoned decimal informat with notation in several programming languages:
    Language
    Zoned Decimal Notation
    SAS
    ZD3.
    PL/I
    PICTURE'99T'
    COBOL
    DISPLAY PIC S 999
    IBM assembler
    ZL3

Example

input @1 x zd4.; 
Data Line 1
Result
----+----1
F0F1F2C8
128
1The data line contains a hexadecimal representation of a binary number that is stored in zoned decimal format on an IBM mainframe computer system. Each byte occupies one column of the input field.

See Also