To access an external file (such as a raw data file or a SAS program),
you can
Filerefs perform the same function as librefs: temporarily pointing to a storage location for data. However, whereas librefs reference SAS data libraries, filerefs reference external files. FILENAME statements remain in effect until you change them, cancel them, or end your SAS session. |
General form, FILENAME statement:
FILENAME fileref 'filename'; where
|
For example, this FILENAME statement temporarily associates the fileref
Exercise with the external file
C:\MyID\Therapy\Rawdata.dat in the Windows environment.
filename exercise 'c:\myid\therapy\rawdata.dat'; You can check the filerefs in effect for your SAS session under File Shortcuts in the Explorer window.
You can use a FILENAME statement to associate a fileref with
|
If the file has . . . | You . . . | Example |
the extension .sas | can omit the extension when referencing the file. | include tax(refund) |
an extension other than .sas | must include the extension and enclose the filename in quotes. | include tax('net.dat') |
no extension | must enclose the filename in quotes. | include tax('income') |
Copyright © 2002 SAS Institute Inc., Cary, NC, USA. All rights reserved.