| SAS Companion for UNIX Environments |
Different computers store numeric binary data in different
forms. Hewlett-Packard, SUN, and RS/6000 store bytes in one order. IBM-compatible
microcomputers and Tru64UNIX (Intel-based UNIX systems) store
bytes in a different order, called byte-reversed.
Binary data stored in one order cannot be read by a
computer that stores binary data in the other order. When you are designing
SAS applications, try to anticipate how your data will be read and choose
your formats and informats accordingly.
The SAS System provides two sets of informats and formats
for handling binary data:
-
The IBw.d, PDw.d, PIBw.d, and
RBw.d. informats and formats read and write data in native mode,
that is, using the byte-ordering system that is standard for the machine.
-
The S370FIBw.d, S370FPDw.d,
S370FPIBw.d, and S370FRBw.d informats and formats force the data to be read and written
according to the IBM 370 standard, regardless of the native mode of the machine.
These informats and formats allow you to write SAS programs that can be run
in any SAS environment, regardless of how numeric data is stored.
If a SAS program that reads and writes binary data runs
on only one type of machine, you can use the native mode informats and formats.
However, if you want to write SAS programs that can be run on multiple machines
using different storage systems for numeric data, use the S370 formats and
informats, which exist for that purpose.
For example, suppose you have a program that writes
data with the PIBw.d format. You execute the
program on a microcomputer so the data is stored in byte-reversed mode. Then
you run another SAS program on the microcomputer that uses the PIBw.d informat to read the data. The data is read correctly because
both the programs are run on the microcomputer, using byte-reversed mode.
However, you cannot upload the data to a Hewlett-Packard 9000-series machine
and read it correctly, because it is stored in a form native to the microcomputer
but foreign to the Hewlett-Packard 9000. To avoid this problem, use the S370FPIBw.d format to write the data; even on the microcomputer, this
causes the data to be stored in IBM 370 mode. Then read the data using the
S370FPIBw.d informat. Regardless of which type
of machine you use when reading the data, it is read correctly.
For more information on all of the informats and formats,
refer to
SAS Language Reference: Dictionary.
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.