To use a SAS data set, you
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:
LIBNAME libref 'SAS-data-library'; where
|
The LIBNAME statement below assigns the libref
Clinic to the SAS data library
D:\Users\Qtr\Reports in the Windows environment.
libname clinic 'd:\users\qtr\reports'; After you assign a libref, you specify it as the first element in the two-level name for a SAS file. For example, to specify that the PRINT procedure read Clinic.Therapy, you specify the two-level name of the file as follows: proc print data=clinic.therapy; run; |
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 you begin a SAS session in order to access SAS files stored in a permanent SAS data library. (Remember that Work is the default libref for a temporary SAS data library.) |
Copyright © 2002 SAS Institute Inc., Cary, NC, USA. All rights reserved.