In this chapter you learn about external files and how to refer to an external file, whether it is a text file or a binary file. You learn how to read data from a file by using the INFILE and INPUT statements and how to write data to an external file by using the FILE and PUT statements.
With external files, you must know the format in which the data are stored or to be written. This is in contrast to SAS data sets, which are specialized files with a structure that is already known to the SAS System.
The SAS/IML statements used to access files are very similar to the corresponding statements in the SAS DATA step. The following table summarizes the SAS/IML statements and their functions.
Statement |
Function |
|
---|---|---|
closes an external file |
||
opens an external file for output |
||
opens an external file for input |
||
reads from the current input file |
||
writes to the current output file |
||
Shows all open files, their attributes, and their status |
||
(current input and output files) |