Previous Page | Next Page

Using External Files and Devices

Accessing an External File or Device in UNIX Environments


Specifying a Pathname or a Fileref

To access an external file or device, you need to specify its pathname or fileref in the appropriate SAS statements:

FILE

specifies the current output file for PUT statements.

%INCLUDE

includes a file that contains SAS source statements that are executed when you submit a program from the Program Editor.

Tip: If you use %INCLUDE, the line limit is 6000 bytes.

INFILE

identifies an external file that you want to read with an INPUT statement.

In the SAS statement, refer to the file or device in one of two ways:


What Is a Fileref?

A fileref is nickname that you assign to a file or device. You assign the fileref once, and then use it as needed. Filerefs are especially useful under the following conditions:

You can assign filerefs in the File Shortcuts window of the Explorer, with the FILENAME statement, with the FILENAME function,(footnote 1) or by defining the fileref as an environment variable.


FOOTNOTE 1:   For a complete description of the FILENAME statement and the FILENAME function, see SAS Language Reference: Dictionary. [arrow]

Previous Page | Next Page | Top of Page