Chapter 37
External Files
Definition of External Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 731
Referencing External Files Directly . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 732
Referencing External Files Indirectly . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 732
Referencing Many External Files Efficiently . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 733
Referencing External Files with Other Access Methods . . . . . . . . . . . . . . . . . . . . . 734
Working with External Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 736
Reading External Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 736
Writing to External Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 736
Processing External Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 736
Definition of External Files
external files
are files that are managed and maintained by your operating system, not by SAS.
They contain data or text or are files in which you want to store data or text. They
can also be SAS catalogs or output devices. Every SAS job creates at least one
external file, the SAS log. Most SAS jobs create external files in the form of
procedure output or output created by a DATA step.
External files used in a SAS session can store input for your SAS job as:
records of raw data that you want to use as input to a DATA step
SAS programming statements that you want to submit to the system for
execution
External files can also store output from your SAS job as:
a SAS log (a record of your SAS job).
a report written by a DATA step.
procedure output created by SAS procedures, including regular list output, and,
beginning in Version 7, HTML and PostScript output from the Output Delivery
System (ODS).
The PRINTTO procedure also enables you to direct procedure output to an external
file. For more information, see Chapter 43, “PRINTTO Procedure” in Base SAS
Procedures Guide. See Chapter 9, “SAS Output,” on page 135 for more information
about ODS.
731

Get SAS 9.4 Language Reference, 3rd Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.