Chapter Contents


SAS Companion for UNIX Environments

Accessing an External File or Device

To read or write to an external file or device, refer to the file or device in the appropriate SAS statements in one of two ways:

In most cases, you will want to use a fileref. A fileref is nickname that you assign to a file or device. You simply assign the fileref once, and then use it as needed. Filerefs are especially useful when

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.

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

specifies the current output file for PUT statements.

includes a file containing SAS source statements into the Program Editor.

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

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

Chapter Contents



Top of Page

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