HEXw. Informat: z/OS

Converts hexadecimal character values to integer binary (fixed-point) or real binary (floating-point) values.
Category: Numeric
Default: 8
Range: 1-16 bytes
z/OS specifics: Interprets input as EBCDIC, IBM floating-point format
See: HEXw. Format: z/OS

HEXw. Informat in SAS Formats and Informats: Reference

Details

Under z/OS, each hexadecimal character that is read by the HEX informat must be represented using the EBCDIC code, with one digit per byte. For example, the hexadecimal number '3B'x is actually stored in the external file as the bit pattern represented by 'F3C2'x, which is the EBCDIC code for 3B. For a table of commonly used EBCDIC characters, see EBCDIC Code: Commonly Used Characters.
The format of floating-point numbers is host specific. See the data representation information in SAS Language Reference: Concepts for a description of the IBM floating-point format that is used under z/OS.
The w value of the HEX informat specifies the field width of the input value. It also specifies whether the final value is an integer binary (fixed-point) value or a real binary (floating-point) value. When you specify a width value of 1 through 15, the input hexadecimal number represents an integer binary number. When you specify a width of 16, SAS interprets the input hexadecimal number as a representation of a floating-point number.
The following examples illustrate the use of the HEXw.d format:
Data Line
Informat
Value
Notes
433E800000000000
HEX16.
1000
input is interpreted as floating point
000100
HEX6.
256
input is interpreted as integer
C1A0000000000000
HEX16.
-10
input is interpreted as floating point
Note: In these examples, Data Line represents the bit pattern stored, which is the value seen when viewed in a text editor. Value is the number that is used by SAS after the data pattern has been read using the corresponding informat.