Chapter 5: Using External Files and Devices


Introduction to External Files and Devices in UNIX Environments

At times during a SAS session, you might want to use external files , that is, files that contain data or text or files in which you want to store data or text. These files are created and maintained by the operating system, not by SAS.

You can use external files in a SAS session to

  • hold raw data to be read with the INPUT statements

  • store printed reports created by a SAS procedure

  • submit a file containing SAS statements for processing

  • store data written with PUT statements.

For SAS, external files and devices can serve both as sources of input and as receivers of output. The input can be either raw data to be read in a DATA step or SAS statements to be processed by SAS. The output can be

  • the SAS log, which contains notes and messages produced by the program

  • the formatted output of SAS procedures

  • data written with PUT statements in a DATA step.

You might also want to use peripheral devices such as a printer, plotter, or your own terminal. UNIX treats these I/O devices as if they were files. Each device is associated with a file, called a special file , which is treated as an ordinary disk file. When you write to a special file, the associated device is automatically activated. All special files reside in the dev directory or its subdirectories. Although there are some differences in how you use the various devices, the basic concept is the same for them all.

UNIX also enables you to use pipes to send data to and from operating system commands as if they were I/O devices.

If you need to access an external file containing a transport data library, refer to Moving and Accessing SAS Files .




SAS 9.1 Companion for UNIX Environments
SAS 9.1 Companion For Unix Enivronments
ISBN: 1590472101
EAN: 2147483647
Year: 2004
Pages: 185
Authors: SAS Institute

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net