Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
File Access

Overview

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 using the INFILE and INPUT statements and how to write data to an external file 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 Interactive Matrix Language statements used to access files are very similar to the corresponding statements in the SAS DATA step. The following table summarizes the IML statements and their functions.

Statement Function
CLOSEFILE closes an external file
FILE opens an external file for output
INFILE opens an external file for input
INPUT reads from the current input file
PUT writes to the current output file
SHOW: FILES shows all open files, their attributes, and their status
  (current input and output files)

Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
Top
Top

Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.