Chapter Contents |
Previous |
Next |
LIBNAME |
Valid: | anywhere |
OS/390 specifics: | libref, engine, physical-filename, engine/host-options |
Syntax | |
Details | |
Assigning Librefs | |
See Also |
Syntax |
LIBNAME libref <engine > <'physical-filename'> < engine/host-options>; |
LIBNAME libref <engine> <('physical-filename-1', ..., 'physical-filename-n')> |
LIBNAME libref | _ALL_ CLEAR; |
LIBNAME libref | _ALL_ LIST; |
Details |
The LIBNAME statement assigns a libref to a SAS data library. The LIBNAME function provides similar functionality. See LIBNAME.
Note: The LIBNAME statement is also used to list the attributes
of a SAS data library and to clear a libref. For more information, see Listing Your Current Librefsand
Deallocating SAS Data Libraries
.
LIBNAME libref <engine > <'physical-filename'> <engine/host-options>; |
You can use this form to assign a libref to either a permanent SAS data library or a temporary one. The following statement allocates a temporary SAS data library, assigns the libref ABC to it, and associates it with the V6 engine:
libname abc v6 '&mytemp' disp=new;
The physical file name for this temporary SAS data library is a specially formatted name chosen by the operating environment; it includes your user prefix and the temporary name that you specify (MYTEMP in this example).
You can use the following arguments with this form of the LIBNAME statement:
Note: Unlike filerefs, librefs cannot include the national
characters $, @, and #.
V8 | specifies the engine for accessing Version 8 SAS files in disk format. BASE is an alias for the V8 engine. |
V78TAPE | specifies the engine for accessing Version 8 SAS files in sequential format, either on tape or on disk. TAPE and V8SEQ are aliases for V8TAPE. |
V7 | specifies the engine for accessing Version 7 SAS files in disk format. |
V7TAPE | specifies the engine for accessing Version 7 SAS files in sequential format, either on tape or on disk. |
V6 | specifies the engine for accessing Version 6 SAS files in disk format. V609, V608, V607, and are aliases for the V6 engine. |
V6TAPE | specifies the engine for accessing Version 6 SAS files in sequential format, either on tape or on disk. V6SEQ is an alias for V6TAPE. |
V5 | specifies the engine for read-only access to Version 5 SAS files on disk. |
V5TAPE | specifies the engine for read-only access to Version 5 SAS files in sequential format, either on tape or on disk. |
XPORT | specifies the engine for accessing SAS files in transport format. |
BMDP | specifies the engine for (read-only) access to BMDP files. |
DB2 | specifies the engine for accessing DB2 database tables. |
ORACLE | specifies the access engine to ORACLE database tables. |
OSIRIS | specifies the engine for (read-only) access to OSIRIS files. |
REMOTE | specifies the engine that SAS/CONNECT and SAS/SHARE use to access remote files. |
SPSS | SPSSX | specifies the engine for (read-only) access to SPSS files. |
If you do not specify an engine, then SAS attempts to assign an engine according to the rules described in How SAS Assigns an Engine When No Engine Is Specified . See the discussion of engines in SAS Language Reference: Dictionary for more information about the library engines.
'myid.raw.datax'
'/u/userid/mylib'or
'HFS:mylib'The HFS prefix needed when the directory does not contain a "/" to indicate an HFS file. This information can also be provided by default by setting the FILESYSTEM= system option. For information on the FILESYSTEM= system option, see FILESYSTEM=.
See Specifying Physical Files for more information about partially qualified data set names.
For some engines, the physical-filename may begin with a single or double ampersand (& or &&), followed by a one- to eight-character value. If the physical-filename begins with &, a temporary physical file is allocated. Such engines are those that can cause a physical file to be created by way of a LIBNAME statement and include the V8, V8TAPE, V7, V7TAPE, V6, and V6TAPE engines. The first character after the & must be alphabetic; others may be alphanumeric or the national characters $, #, or @.
The physical-filename argument is optional. If you specify it, it must follow the engine name. If you did not specify an engine, then it must follow the libref.
keyword=value | keyword |
When you specify more than one option, use a blank space to separate each option. The specific options that are available depend on which engine you have specified. See Engine/Host Options for the V8 Engine for details about specific engine/host-options, and about the values that you specify with the various engines.
The complete list of options is presented here:
The implementation of the DATACLAS= option is compatible with the SMS DATACLAS= JCL parameter. For complete information about this parameter, see OS/390 JCL Reference by IBM. Ask your system administrator which data-class names are used for SAS data libraries at your site.
NEW | a new data set is to be created. |
OLD | the data set exists and is not to be shared. |
SHR | the data set exists and may be shared. |
The default for status is OLD.
DELETE | the data set is deleted at the end of the step. |
KEEP | the data set is to be kept. |
CATLG | the system should place an entry in the system catalog or user catalog. |
UNCATLG | the system is to delete the entry in the system catalog or user catalog. |
DELETE | the data set is deleted at the end of the step. |
KEEP | the data set is to be kept. |
CATLG | the system should place an entry in the system catalog or user catalog. |
UNCATLG | the system is to delete the entry in the system catalog or user catalog. |
The LABEL= option is identical to the JCL LABEL= parameter. Here is a simple example:
label=(3,SL,,,EXPDT=1999/123)
This label specification indicates the data set sequence number is 3, that it uses standard labels, and that it expires on the 123rd day of 1999. See OS/390 JCL Reference by IBM for complete information about how to use the LABEL= option, including which subparameters you can specify in subparameter-list.
The implementation of the MGMTCLAS= option is compatible with the SMS MGMTCLAS= JCL parameter. For complete information about this parameter, see OS/390 JCL Reference by IBM. Ask your system administrator which management class names are used at your site.
TRK | specifies that the space is to be allocated in tracks. |
CYL | specifies that the space is to be allocated in cylinders. |
blklen | specifies that the space is to be allocated in blocks whose block length is blklen bytes. The system computes how many tracks are allocated. |
CONTIG | means that the space to be allocated must be contiguous. |
MXIG | means that the maximum contiguous space is required. |
ALX | means that different areas of contiguous space are needed. |
If SPACE is not defined, its values are taken from the SAS system options FILEUNIT=, FILESPPRI=, and FILESPSEC=, in the following form:
SPACE=(FILEUNIT,(FILESPPRI,FILESPSEC))
The default specifications are as follows:
SPACE=(CYL,(1,1))
The implementation of the STORCLAS= option is compatible with the SMS STORCLAS= JCL parameter. For full details on this parameter, refer to OS/390 JCL Reference by IBM. Ask your system administrator which storage class names are used at your site.
When you use the WAIT= option, you must also specify the engine name in the LIBNAME statement if you are accessing uncataloged data libraries or libraries that do not reside on disk. Otherwise, you do not have to specify the engine name.
For batch jobs using WAIT=, also specify the FILEMSGS option (see FILEMSGS), which causes a message to be written to the system log for each allocation attempt, thus allowing system operators to determine why the job is waiting.
See Also |
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.