Chapter Contents |
Previous |
Next |
Definitions |
Using Binary Informats |
Different computer platforms store numeric binary data in different forms. The ordering of bytes differs by platforms and is referred to as either "big endian" or "little endian." For a list of platforms considered big endian and little endian, see Byte Ordering on Big Endian and Little Endian Platforms.
SAS provides a number of informats for reading binary data and corresponding formats for writing binary data. Some of these informats read data in native mode, that is, by using the byte-ordering system that is standard for the system on which SAS is running. Other informats force the data to be read by the IBM 370 standard, regardless of the native mode of the system on which SAS is running. The informats that read in native or IBM 370 mode are listed in the following table.
Description | Native Mode Informats | IBM 370 Mode Informats | |
---|---|---|---|
ASCII Character | $w. | $ASCIIw. | |
ASCII Numeric | w.d |
$ASCIIw. | |
EBCDIC Character | $w. | $EBCDICw. | |
EBCDIC Numeric (Standard) | w.d |
S370FFw.d | |
Integer Binary | IBw.d | S370FIBw.d | |
Positive Integer Binary | PIBw.d | S370FPIBw.d | |
Real Binary | RBw.d | S370FRBw.d | |
Unsigned Integer Binary | PIBw.d | S370FIBUw.d, S370FPIBw.d | |
Packed Decimal | PDw.d | S370FPDw.d | |
Unsigned Packed Decimal | PKw.d | S370FPDUw.d or PKw.d | |
Zoned Decimal | ZDw.d | S370FZDw.d | |
Zoned Decimal Leading Sign | S370FZDLw.d | S370FZDLw.d | |
Zoned Decimal Separate Leading Sign | S370FZDSw.d | S370FZDSw.d | |
Zoned Decimal Separate Trailing Sign | S370FZDTw.d | S370FZDTw.d | |
Unsigned Zoned Decimal | ZDw.d | S370FZDUw.d |
If you write a SAS program that reads binary data and that will be run on only one type of system, you can use the native mode informats and formats. However, if you want to write SAS programs that can be run on multiple systems that use different byte-storage systems, use the IBM 370 informats. The IBM 370 informats enable you to write SAS programs that can read data in this format and that can be run in any SAS environment, regardless of the standard for storing numeric data.(footnote 1) The IBM 370 informats can also be used to read data originally written with the corresponding native mode formats on an IBM mainframe.
For complete descriptions of all SAS formats and informats, including how numeric binary data is written, see SAS Language Reference: Dictionary.
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.