Command reference / library
CRTLIB
Create Library
Adds a new library to the system. A library must exist before objects can be placed in it. Once created, it appears as though it exists in the QSYS (system) library.
Allowed environments: *ALL.
Positional parameters: 2.
Restrictions
- Libraries named QRCL or QRPLOBJ can only be created in the system ASP (ASP 1).
- Libraries named QRCLxxxxx or QRPLxxxxx can only be created in the ASP whose number matches xxxxx (the ASP number zero-padded on the left); for example, QRPL00033 can only be created in ASP 33.
- Library QSPLnnnn, when created in a primary or secondary ASP, must be created in the ASP whose number matches nnnn.
- Libraries named QSYSxxxxx, QSYS2xxxxx, or SYSIBxxxxx (xxxxx is a number) cannot be created.
Parameters
LIB
Library
Specifies the library to be created. Avoid names beginning with Q, because the system assumes those are system libraries. This parameter is required.
TYPE
Library type
Specifies the type of library to be created. Use *PROD for a production library or *TEST for a test library.
Allowed values:
*PROD, *TEST
*PROD- Production library. If a user in debug mode has requested that production libraries be protected, its database files cannot be opened for update.
*TEST- Test library. All objects can be updated during testing, even when production libraries are specially protected.
TEXT
Text 'description'
Specifies text that briefly describes the library, up to 50 characters enclosed in apostrophes.
Suggested / special values:
*BLANK
*BLANK- The text is set to blanks.
AUT
Authority
Specifies the default public authority for the library. It applies to users with no specific library authority, who are not on the library's authorization list, and whose group profiles have no specific authority.
Suggested / special values:
*LIBCRTAUT, *CHANGE, *ALL, *USE, *EXCLUDE
*LIBCRTAUT- Same as the create authority of the QSYS library, which can be displayed with DSPLIBD.
*CHANGE- Allows all library operations except those limited to the owner or to *OBJEXIST and *OBJMGT authority. Includes *OBJOPR and all data authority.
*ALL- Allows all operations except those limited to the owner or *AUTLMGT authority. The user can also change library ownership.
*USE- Allows basic operations such as running a program or reading a file. The user cannot change the library.
*EXCLUDE- The user cannot access the library.
ASP
ASP number
Specifies the number of the system or basic user ASP where storage for the library is allocated. All objects in the library must be in the same ASP as the library.
Suggested / special values:
*ASPDEV
*ASPDEV- Storage is allocated from the primary or secondary ASP named by the ASPDEV parameter.
ASPDEV
ASP device
Selects the ASP device for library storage. A named independent ASP must be varied on and Available. When ASPDEV is other than *ASP, an explicitly supplied ASP must be *ASPDEV.
Suggested / special values:
*ASP, *ASPGRPPRI, *SYSTEM
*ASP- Use the system or basic user ASP selected by ASP.
*ASPGRPPRI- Use the primary ASP of the thread's ASP group; fail if it has no ASP group.
*SYSTEM- Allocate storage from system ASP 1.
name- Allocate storage from the named primary or secondary ASP; *USE authority is required for each device in the group.
CRTAUT
Create authority
Specifies the default public authority for objects created into this library. It is used when an object's AUT parameter is *LIBCRTAUT.
Suggested / special values:
*SYSVAL, *CHANGE, *ALL, *USE, *EXCLUDE
*SYSVAL- The value of the QCRTAUT system value is used when an object is created into the library.
*CHANGE- The user can perform all operations on new objects except those limited to the owner or to *OBJEXIST and *OBJMGT authority.
*ALL- The user can perform all operations except those limited to the owner or *AUTLMGT authority, and can change ownership.
*USE- The user can perform basic operations such as running a program or reading a file, but cannot change the object.
*EXCLUDE- The user cannot access the object.
CRTOBJAUD
Create object auditing
Specifies the auditing value for objects created in this library. Using a value other than *SYSVAL requires *AUDIT special authority.
Allowed values:
*SYSVAL, *NONE, *USRPRF, *CHANGE, *ALL
*SYSVAL- The value of the QCRTOBJAUD system value is used when an object is created into the library.
*NONE- Using or changing the object does not send an audit entry to the security journal.
*USRPRF- The object auditing value of the user profile, set with CHGUSRAUD, determines whether an audit entry is sent.
*CHANGE- All change access to the object by all users sends an audit entry.
*ALL- All change or read access to the object by all users sends an audit entry.
Examples
CRTLIB LIB(MYLIB) TEXT('My Production Library')
Adds production library MYLIB with the text 'My Production Library'. Only the owner has *OBJEXIST and *OBJMGT authority; other users get authority from the create authority of QSYS because AUT defaults to *LIBCRTAUT.
CRTLIB LIB(Z) TYPE(*TEST) AUT(*EXCLUDE) TEXT('This is a test library')
Adds test library Z. Only its owner can use it, because no other users are granted any authority.
CRTLIB LIB(INVENTORY) ASPDEV(SALES) TEXT('Inventory Library on SALES ASP')
Adds production library INVENTORY in the independent ASP named SALES. The SALES ASP must be varied on and have status 'Available'.
Generated from os/cl/catalog/CRTLIB.json and os/cl/help/CRTLIB.json.