Converts real binary (floating-point) numbers to hexadecimal representation
Category: Numeric
Width range: 1to16
Default width: 8
Alignment: left
UNIX specifics: floating-point representation
See: HEXw. format in SAS Language Reference: Dictionary
The HEX w. format converts a real (floating-point) binary number to its hexadecimal representation. When you specify a width value of 1 through 15, the real binary number is truncated to a fixed-point integer before being converted to hex. When you specify 16 for the width, SAS writes the floating-point value of the number but does not truncate it.
Note | UNIX systems vary widely in their floating-point representation. See "Reading and Writing Binary Data in UNIX Environments" on page 198 for more information. |
Converts character values to hexadecimal representation
Category: Character
Width range: 1 to 32767
Default width: 4
Alignment: left
UNIX specifics: produces ASCII codes
See: $HEXw. format in SAS Language Reference: Dictionary
Under UNIX, the $HEX w. format produces hexadecimal representations of ASCII codes for characters , with each byte requiring two columns. Therefore, you need twice as many columns to output a value with the $HEX w. format.
Writes integer binary values
Category: Numeric
Width range: 1to8
Default width: 4
Decimal Range: 0 “10
Alignment: left
UNIX specifics: byte order
See: IBw.d format in SAS Language Reference: Dictionary
The IB w.d format writes integer binary (fixed-point) values. Integers are stored in integer-binary, or fixed-point, form. For example, the number 2 is stored as 00000002. If the format includes a d value, the data value is multiplied by 10 d .
For more details, see "Reading and Writing Binary Data in UNIX Environments" on page 198.
Writes packed decimal data
Category: Numeric
Width range: 1to16
Default width: 1
Decimal Range: 0 “31
Alignment: left
UNIX specifics: data representation
See: PDw.d format in SAS Language Reference: Dictionary
The PD w.d format writes values in packed decimal format. In packed decimal data, each byte contains two digits. The w value represents the number of bytes, not the number of digits. The value's sign is the first byte. Because the entire first byte is used for the sign, you should specify at least a width of 2.
For more details, see "Reading and Writing Binary Data in UNIX Environments" on page 198.
Writes positive integer binary values
Category: Numeric
Width range: 1 to 8
Default width: 1
Decimal Range: 0 “10
Alignment: left
UNIX specifics: byte order
See: PIBw.d format in SAS Language Reference: Dictionary
The PIB w.d format writes fixed-point binary values, treating all values as positive. Thus, the high-order bit is part of the value, rather than the value's sign. If a d value is specified, the data value is multiplied by 10 d .
For more details, see "Reading and Writing Binary Data in UNIX Environments" on page 198.
Writes real binary (floating-point) data
Category: Numeric
Width range: 2to8
Default width: 4
Decimal Range: 0 “10
Alignment: left
UNIX specifics: floating-point representation
See: RBw.d format in SAS Language Reference: Dictionary
The RB w.d format writes numeric data in real binary (floating-point) notation. SAS stores all numeric values in floating-point.
Real binary is the most efficient format for representing numeric values because SAS already represents numbers this way and no conversion is needed.
For more details, see "RB w.d Informat" on page 260 and "Reading and Writing Binary Data in UNIX Environments" on page 198.
Writes zoned decimal data
Category: Numeric
Width range: 1to32
Default width: 1
Alignment: left
UNIX specifics: data representation
See: ZDw.d format in SAS Language Reference: Dictionary
The ZD w.d format writes zoned decimal data. This format is also known as overprint trailing numeric format. Under UNIX, the last byte of the field includes the sign along with the last digit. The conversion table for the last byte is as follows :
Digit | ASCII Character |
---|---|
| { |
1 | A |
2 | B |
3 | C |
4 | D |
5 | E |
6 | F |
7 | G |
8 | H |
9 | I |
-0 | } |
-1 | J |
-2 | K |
-3 | L |
-4 | M |
-5 | N |
-6 | O |
-7 | P |
-8 | Q |
-9 | R |
For more details, see "ZD w.d Informat" on page 261 and "Reading and Writing Binary Data in UNIX Environments" on page 198.