
121
8
Data Input and Output
8.1 Introduction to Reading and Writing Text Files
A SAS
®
data set is often created by reading data directly from an external
text le. Observations (rows) and variables (columns) in the SAS data set cor-
respond to records and the elds in the text le. You can go in the opposite
direction and create a text le from a SAS data set. This section provides an
overview for reading and writing text les, as well as an introduction to SAS
informats and formats.
8.1.1 Steps for Reading Text Files
To read an external text le into SAS, you need to use an INFILE statement
followed by the INPUT statement. The INFILE statement ha ...