Chapter Contents |
Previous |
Next |
Physical Names and Logical Names (Librefs) |
The logical name, or libref, is the way you identify a group of files to SAS. A libref is a temporary name that you associate with the physical name of the SAS data library during each SAS job or session.
Librefs that you specify remain in effect until the SAS session ends, unless you create them in the SAS New Library window and check the "Enable at startup" box when you create the library. The New Library window is available in your Toolbar.
Assigning Librefs |
Librefs can be assigned with the following:
Operating Environment Information: The rules for assigning and using librefs differ across operating environments. See the SAS documentation for your operating environment for more specific information. To assign a library name to your SAS data library using the physical name, you assign a libref to the library, followed by the physical location, enclosed in single quotation marks.
If running in batch mode, the library must exist before you can allocate or assign it. In interactive mode, you may be allowed to create it if it does not already exist.
Operating Environment | Examples | |
---|---|---|
DOS, Windows |
libname mylibref 'c:\root\mystuff\sasstuff\work' ; |
|
UNIX |
libname mylibref '/u/mystuff/sastuff/work'; |
|
UNIX System Services under OS/390 |
libname mylibref '/mystuff/sastuff/work'; |
|
CMS |
libname mylibref '< filetype> filemode |* '; |
|
OS/390 Open Edition |
libname mylibref 'my.data_library'; |
|
OS/390 |
libname mylibref 'userid.mystuff.sastuff.work'; |
|
VAX/ALPHA |
libname mylibref 'filename filetype filemode'; |
Associating and Clearing Logical Names (Librefs) With the Libname Statement |
You can assign or clear a physical name with
a libref using the LIBNAME
statement, or the LIBNAME function, which are described in the
SAS Language Reference:
Dictionary.
Operating Environment Information:
libname annual 'SAS-data-library';
If you use the LIBNAME statement to assign the libref, SAS clears (deassigns) the libref automatically at the end of each SAS session. If you want to clear the libref ANNUAL before the end of the session, you can issue the following form of the LIBNAME statement:
libname annual clear;
SAS also provides a New Library window to assign or clear librefs and SAS Explorer to view, add or delete SAS data libraries. You can select the New Library or the SAS Explorer icon from the Toolbar.
Reserved Librefs |
SAS reserves a few names for special uses. You should not use SASHELP, SASUSER or SASWORK as librefs, except as intended. The purpose and content of these libraries are discussed later in this section.
Operating Environment Information: There are other librefs reserved for SAS under some operating environments. In addition, your operating environment may have reserved certain words that cannot be used as librefs. 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.