Setting Up Your SAS Session |
Referencing Files in SAS
Libraries |
Assigning Librefs
To define libraries, you can use a LIBNAME statement. You can store the LIBNAME statement with any SAS program to reference the SAS library automatically when you submit the program. |
General form, basic LIBNAME statement:
where
|
The LIBNAME statement below assigns the libref
Clinic to the SAS library
D:\Users\Qtr\Reports in the Windows environment.
libname clinic 'd:\users\qtr\reports'; |
How Long Librefs Remain in Effect
The LIBNAME statement is global, which means that its settings remain in effect until you modify them, cancel them, or end your SAS session. Therefore, the LIBNAME statement assigns the libref for the current SAS session only. You must assign a libref each time that you begin a SAS session in order to access SAS files stored in a permanent SAS library. (Remember that Work is the default libref for a temporary SAS library.) |
Remember that when you use the New Library Window to create a libref, you can select Enable at Startup and your libref will be created each time you start SAS. |
Copyright © 2002 SAS Institute Inc.,
Cary, NC, USA. All rights reserved.