Chapter 39
External Files
Definition of External Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 761
Referencing External Files Directly . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 762
Referencing External Files Indirectly . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 762
Referencing Many External Files Efficiently . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 763
Referencing External Files with Other Access Methods . . . . . . . . . . . . . . . . . . . . . 764
Working with External Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 766
Reading External Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 766
Writing to External Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 766
Processing External Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 766
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 “PRINTTO Procedure” in Base SAS Procedures
Guide. See Chapter 9, “SAS Output,” on page 155 for more information about ODS.
761

Get SAS 9.4 Language Reference, 6th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.