CL Command Reference - CRTLIB
CL Command List > CRTLIB Reference
Description:
The Create Library (CRTLIB) command adds a new library to the system. Before any objects are placed into a library, the library must have been created. When the library is created, it appears as though it exists in the QSYS (system) library.
Restrictions:
1. A library with the name QRCL or QRPLOBJ can only be created in the system ASP (ASP 1).
2. A library with the name QRCLxxxxx or QRPLxxxxx can only be created in the ASP for which the ASP number corresponds to ¡¯xxxxx¡¯ (where ¡¯xxxxx¡¯ is the number of a primary ASP right adjusted and padded on the left with zeros); for example, library QRPL00033 can only be created in the ASP device corresponding to ASP number 33.
3. When library QSPLnnnn is created in a primary or secondary ASP, it must be created in the ASP for which the ASP number corresponds to ¡¯nnnn¡¯ (where ¡¯nnnn¡¯ is the number of a primary or secondary ASP right adjusted and padded on the left with zeros).
4. You cannot create a library with the name QSYSxxxxx, QSYS2xxxxx, or SYSIBxxxxx (where ¡¯xxxxx¡¯ is a number).
Examples:
Example 1: Creating a Production Library
CRTLIB LIB(MYLIB) TEXT(¡¯My Production Library¡¯)
The library MYLIB is added to the system. The library is a production library; only the owner has object existence (*OBJEXIST) and object (*OBJMGT) management authorities for it. The authority for other users for library MYLIB is determined by the create authority of library QSYS, since *LIBCRTAUT was assumed for the AUT parameter. The text, ¡¯My Production Library¡¯, is displayed whenever the library description for MYLIB is displayed.
Example 2: Creating a Test Library
CRTLIB LIB(Z) TYPE(*TEST) AUT(*EXCLUDE)
TEXT(¡¯This is a test library¡¯)
Test library Z is added to the system. Only the owner of Z can use it because no other users have been granted any authority. The specified text (¡¯This is a test library¡¯) is displayed whenever the library description for Z is displayed.
Example 3: Creating a Library in an Independent Auxiliary Storage Pool (ASP)
CRTLIB LIB(INVENTORY) ASPDEV(SALES)
TEXT(¡¯Inventory Library on SALES ASP¡¯)
The library INVENTORY is added to the system in an independent auxiliary storage pool (ASP) named SALES. The SALES ASP must have been activated (by varying on the ASP device) and have a status of ¡¯Available¡¯. The library is a production library; only the owner has object existence (*OBJEXIST) and object management (*OBJMGT) authorities for it. The authority for other users to library INVENTORY is determined by the create authority of library QSYS, since *LIBCRTAUT was assumed for the AUT parameter. The text, ¡¯Inventory Library on SALES ASP¡¯, is displayed whenever the library description for INVENTORY is displayed.