Chapter Contents |
Previous |
Next |
LIBNAME |
Language element: | statement |
Valid: | anywhere in a SAS program |
OpenVMS specifics: | valid values for engine-name; specifications for SAS-data-library; valid values for engine/host-option-list |
Syntax | |
Details | |
Associating Librefs | |
Listing Data Library Attributes | |
See Also |
Syntax |
LIBNAME libref
<engine> 'SAS-data-library'
|
|
|
Note: This is a simplified version of the LIBNAME statement
syntax. For the complete syntax and its explanation, see the LIBNAME statement
in SAS Language Reference: Dictionary.
For an explanation of the LIBNAME statement arguments in the OpenVMS operating environment, see Associating Librefs.
Details |
The LIBNAME statement associates a libref with a permanent SAS data library and lists the file attributes of a SAS data library.
Note: The LIBNAME statement is also used to clear a
libref. For complete documentation on this use, see the LIBNAME statement
in SAS Language Reference: Dictionary.
LIBNAME libref <engine> 'SAS-data-library' <portable-options> <engine/host-options>;
The libref can also be an OpenVMS logical name or a search-string logical name. For more information, see Using an OpenVMS Logical Name in the LIBNAME Statement and Using a Search-String Logical Name to Concatenate SAS Data Libraries.
Under OpenVMS, the only reserved librefs are those that are reserved by the SAS System on all operating environments. For a list of reserved librefs, see the LIBNAME statement in SAS Language Reference: Dictionary.
If you do not specify an engine, then SAS uses the procedures described in How SAS Assigns an Engine When No Engine Is Specified to assign an engine for you.
If the directory that you specify does not already exist, then you must create it before you attempt to use the libref that you have assigned to it. (Under OpenVMS, the LIBNAME statement does not actually create directories.)
Use the following syntax for concatenated libraries:
LIBNAME libref ('SAS-data-library' '...'Note that librefs can be used as part of a physical name or a previously assigned libref.
The level of specification depends on your current location in the OpenVMS file structure. For example, if you want to access a directory that is located on another node in your OpenVMS network, then the file specification in the LIBNAME statement must include the node, the device, and the directory levels.
The file specification generally must not extend beyond the directory or subdirectory level (that is, it must not include a filename), because the libref/directory association that is made in the LIBNAME statement gives you access to all SAS files in the data library, not to a single file. However, this rule does not apply if you are assigning a libref for use with the XPORT, OSIRIS, or SPSS engines.
SAS-data-library can also be an OpenVMS logical name (or a path that contains a logical name). In this case, you would be assigning a libref to the logical name, and you would subsequently use the libref in your SAS program. For examples, see Using an OpenVMS Logical Name in the LIBNAME Statement.
Note: Directory wildcard specifications are not supported
in LIBNAME statements. If you use an asterisk (*) or an ellipsis (...) in
the SAS-data-library argument, an error message
tells you that the physical name of the library is invalid.
For a complete listing of the available external I/O statement options, see Summary of External I/O Statement Options in the FILENAME statement.
Not every option is available with every engine. For information about which engine or host options are available with each engine, see Using SAS Engines.
All of these options correspond to a data set option of the same name and have the same effect as the data set option. However, engine or host options apply to all SAS data sets that are stored in the SAS data library.
Specify as many options as you need. Separate them with a blank space.
You can use the LIBNAME statement to list attributes of SAS data libraries by using the LIST option.
See Also |
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.