|SAS Companion for UNIX Environments
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
- specifying the pathnames for the files.
- assigning a fileref to a device, one or more
or a directory and using the fileref when you want to refer to the file or
- the pathname is long and has to be specified several
times within a program
- the pathname might change. If the pathname changes,
you need to change only the statement that assigns the fileref, not every
reference to the file.
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
to specify its pathname or fileref in the appropriate SAS statements:
- specifies the current output file for PUT
- 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.
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.