Enables access to an existing CMS library or libraries. Subsequent CMS commands automatically refer to the libraries identified by this command. Format: SET LIBRARY directory-specification[,...]
1 – Command Parameters
directory-specification Specifies one or more existing CMS libraries. The directory that is used as the CMS library cannot be your current default directory. The directory specification must conform to OpenVMS conventions; it can also be a logical name. If you specify more than one OpenVMS directory, you must separate the directory specifications with commas. Wildcards are not allowed.
2 – Description
The SET LIBRARY command enables access to an existing CMS library or list of libraries. Subsequent CMS commands automatically refer to the library or libraries identified in the SET LIBRARY command. The SET LIBRARY command defines logical names beginning with CMS$ that allow CMS commands to refer implicitly to the library. You should not define logical names beginning with CMS$ because this prefix is reserved for CMS. The SET LIBRARY command performs some consistency checks on the directory to verify that it is a valid CMS library (unless you specify the /NOVERIFY qualifier). If the library is not valid, you receive an error message. The library must have been created with the CREATE LIBRARY command. During each session in which you want to use your CMS library, you must use the SET LIBRARY command before you access a library. The command is not required, however, if you have just created a library (see the description of the CREATE LIBRARY command) because the CREATE LIBRARY command performs an implicit SET LIBRARY. You create a search list by specifying multiple libraries on the SET LIBRARY command. This enables you to manipulate several libraries with one command. You must include commas between the directory specifications.
3 – Qualifiers
3.1 /AFTER[=directory-specification]
Instructs CMS to insert new libraries into the existing library search list (that you previously specified by using a comma list with the CREATE LIBRARY or SET LIBRARY command) immediately following the existing specified directory. If you omit the directory specification, CMS adds the libraries to the end of the list. You cannot specify both /AFTER and /BEFORE on the same command line. By default, the SET LIBRARY command's library list supersedes any existing search list.
3.2 /BEFORE[=directory-specification]
Instructs CMS to insert new libraries into the existing library search list (that you previously specified by using a comma list with the CREATE LIBRARY or SET LIBRARY command) immediately in front of the existing specified directory. If you omit the directory specification, CMS adds the libraries to the front of the list. You cannot specify both /AFTER and /BEFORE on the same command line. By default, the SET LIBRARY command's library list supersedes any existing search list.
3.3 /LOG (D)
Controls whether CMS displays success and informational messages on the default output device. By default, if the command executes successfully, CMS displays a success message. If you specify /NOLOG, success and informational messages are suppressed. Any warning, error, or fatal error messages are displayed regardless of whether /LOG or /NOLOG is specified.
3.4 /VERIFY (D)
Allows you to set a library without performing the locking and verification process CMS normally performs. This speeds up the SET LIBRARY operation and allows a CMS library to be set even if the library is locked by another user. However, if the library needs recovery, the condition is not detected until another transaction is attempted.
4 – Examples
(1) CMS> SET LIBRARY [WORK.CMSLIB] %CMS-S-LIBIS, CMS library is DISKX:[WORK.CMSLIB] This command sets the CMS library to the existing library [WORK.CMSLIB]. (2) CMS> SET LIBRARY [WORK.CMSLIB],[TEST.CMSLIB] %CMS-I-LIBIS, library is DISK$:[WORK.CMSLIB] %CMS-I-LIBINSLIS, library DISK$:[TEST.CMSLIB] inserted at end of library list %CMS-S-LIBSET, library set -CMS-I-SUPERSEDE, library list superseded This command sets (or resets, if there was an existing library or libraries) the current library to contain two libraries. (3) CMS> SET LIBRARY [PROJECT.CMSLIB]/AFTER=[WORK.CMSLIB] %CMS-I-LIBINSLIS, library DISK$:[PROJECT.CMSLIB] inserted after DISKX:[WORK.CMSLIB] %CMS-S-LIBSET, library set Assuming you set your library as in example 2, this command directs CMS to insert the library [PROJECT.CMSLIB] after the library [WORK.CMSLIB]. The library list now contains the three libraries [WORK.CMSLIB], [PROJECT.CMSLIB], and [TEST.CMSLIB], in that order. Use the SHOW LIBRARY command to display the library search list.