Chapter Contents |
Previous |
Next |
Four special SAS System supplied libraries provide convenience, support, and customization capability:
WORK Library |
To store or retrieve SAS files in the WORK library, specify a one-level name in your SAS program statements. The libref WORK is automatically assigned to these files as a system default unless you have assigned the USER libref. The following examples contain valid names for SAS data sets stored in the WORK library:
data test2;
data work.test2;
proc contents data=testdata;
proc contents data=work.testdata;
open ('testfunc');
Operating Environment Information: The
WORK library is implemented differently in various
operating environments. See the SAS documentation for your operating environment
for more information.
While the WORK library is designed to hold temporary files used during
the current SAS session, the USER library is designed to hold files after
the SAS session is over. If you associate the libref USER with a SAS data
library, use a one-level name to create and access files that are not deleted
at the end of your SAS session. When SAS encounters a one-level filename,
it looks first in the USER library, if it has been defined, and then it looks
in WORK. If you wish to place a file in the USER library, so that it is not
deleted after your SAS session is over, any single-level file goes there by
default. At that point, if you want to create a temporary file in WORK, you
must use a two-level name, such as
WORK.name
.
USER Library |
You can assign the USER libref using
libname user 'SAS-data-library'; data region; ... more DATA step statements ... run;In this example, the LIBNAME function assigns the USER libref:
data _null_; x=libname ('user', 'SAS-data-library'); run;When assigning a libref using the USER= system option, you must first assign a libref to a SAS data library, then use the USER= system option to specify that library as the default for one-level names. In this example, the DATA step stores the data set PROCHLOR in the SAS data library TESTLIB.
libname testlib 'SAS-data-library'; options user=testlib; data prochlor; ... more DATA step statements ... run;
Operating Environment Information: The methods
and results of assigning the USER libref
vary slightly from one operating environment to another. See the SAS documentation
for your operating environment for more information.
The USER libref overrides the default libref WORK for one-level names. When you refer to a file by a one-level name, SAS looks first for the libref USER. If USER is assigned to a SAS data library, files with one-level names are stored there. If you have not assigned the libref USER to a library, the files with one-level names are stored in the temporary library WORK. To refer to SAS files in the WORK library while the USER libref is assigned, you must specify a two-level name with WORK as the libref. Data files that SAS creates internally still go to the WORK library.
SASHELP Library |
If SAS products other than base SAS are installed at your site, the SASHELP library contains catalogs that are used by those products. In many instances, the defaults in this library are tailored to your site by your SAS Software Representative. You can list the catalogs stored at your site by using one of the file management utilities discussed later in this section.
SASUSER Library |
SAS assigns the SASUSER library during system initialization, according to the information supplied by the SASUSER system option.
A system option called RSASUSER allows the system administrator to control the mode of access to the SASUSER library at installations that have one SASUSER library for all users and that want to prevent users from modifying it.
Operating Environment Information: In most operating environments, the SASUSER data library is created if it does not already exist. However, the SASUSER library is implemented differently in various operating environments. See the SAS documentation for your operating environment for more information.
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.