CRTLIB (Create Library)

CRTLIB Command syntax diagram

 

Purpose

The Create Library (CRTLIB) command adds a new library to the system. The library must have been created before any objects can be placed into it. When the library is created, it is actually stored as part of the internal system. However, although it is a separate library, it appears as though it exists in the QSYS (system) library.

 

Restrictions

  1. You must have *AUDIT special authority to specify a value other than *SYSVAL on the CRTOBJAUD parameter.
  2. You must have *USE authority to the auxiliary storage pool (ASP) device if a specific ASP device name is specified on the ASPDEV parameter.>
  3. Library QRCL or QRPLOBJ can only be created in the system ASP (ASP 1).>
  4. Library 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).>
  5. You cannot create a library with the name QSYSxxxxx, QSYS2xxxxx, or SYSIBxxxxx (where 'xxxxx' is a number).>

 

Required Parameters

LIB
Specifies the name of the library being created.

Note: Do not use a name that begins with the character Q. The system assumes that libraries with those names are system libraries.

 

Optional Parameters

TYPE
Specifies the type of library being created.

*PROD: This is a production library. Database files in production libraries cannot be opened for updating if a user is in debug mode and requests that production libraries be protected. A user can protect all database files in production libraries by specifying UPDPROD(*NO) on the Start Debug (STRDBG) command to begin testing. However, this protection does not prevent the program from deleting database files or from changing other objects (such as data areas) in the library.

*TEST: This is a test library. All objects in a test library can be updated during testing, even if special protection is requested for production libraries.

AUT
Specifies the authority given to users who do not have specific authority to the library, who are not on an authorization list, and whose user group has no specific authority to the library.

*LIBCRTAUT: The authority for the object is the same as the create authority for QSYS. The create authority for QSYS can be displayed by using the Display Library Description (DSPLIBD) command. If the create authority is changed with the Change Library (CHGLIB) command, the new authority does not affect existing objects.

*USE: The user can perform basic operations on the library, such as running a program or reading a file. The user cannot change the library. *USE authority provides object operational authority, read authority, and execute authority.

*CHANGE: The user can perform all operations on the object except those limited to the owner or controlled by object existence authority and object management authority. The user can change and perform basic functions on the object. Change authority provides object operational authority and all data authority. If the object is an authorization list, the user cannot add, change, or remove user ids.

*ALL: The user can perform all operations except those limited to the owner or controlled by authorization list management authority. The user can control the object's existence, specify the security for the object, change the object, and perform basic functions on the object. The user also can change ownership of the library.

*EXCLUDE: The user cannot access the library.

authorization-list-name: Specify the name of the authorization list used.

CRTAUT
Specifies, when an object is created in this library, the authority given to users who do not have specific authority to an object (public authority), who are not on the authorization list, and whose user groups have no specific authority to an object.

*SYSVAL: The QCRTAUT system value is used.

*USE: The user can perform basic operations on the library, such as running a program or reading a file. The user cannot change the library. *USE authority provides object operational authority, read authority, and execute authority.

*CHANGE: The user can perform all operations on the object except those limited to the owner or controlled by object existence authority and object management authority. The user can change and perform basic functions on the object. Change authority provides object operational authority and all data authority.

*ALL: The user can perform all operations on the object except those limited to the owner or controlled by authorization list management authority. The user can control the object's existence, specify the security for the object, change the object, and perform basic functions on the object. The user cannot transfer ownership of the object. If the object is an authorization list, the user cannot add, change, or remove user IDs.

*EXCLUDE: The user cannot access the library.

authorization-list-name: Specify the name of the authorization list whose authority is used for the object.

CRTOBJAUD
Specifies the auditing value for objects created in this library.

*SYSVAL: The value specified in the system value QCRTOBJAUD is used.

*NONE: Using or changing this object will not cause an audit entry to be sent to the security journal.

*USRPRF: The user profile of the user accessing this object is used to determine if an audit record will be sent for this access. The OBJAUD keyword of the CHGUSRAUD command is used to turn on auditing for a specific user.

*CHANGE: All change accesses to this object by all users are logged.

*ALL: All change or read accesses to this object by all users are logged.

ASP
Specifies the number of the auxiliary storage pool (ASP) from which the system allocates storage for the library. For libraries created in an ASP, all objects in the library must be in the same ASP as the library. When a value other than *ASP is specified for the ASPDEV parameter, *ASPDEV is the only valid value for ASP, if specified.

1: The storage is allocated for the library from the system ASP (ASP 1).

*ASPDEV: The storage is allocated for the library from the ASP specified for the ASPDEV parameter.

auxiliary-storage-pool-number: Specify a value ranging from 1 through 32 for the ASP number. These values depend on how ASPs are defined on the system.End of change

ASPDEV
Specifies the auxiliary storage pool (ASP) device name where storage is allocated for the library. When a value other than *ASPDEV is specified for the ASP parameter, *ASP is the only valid value for ASPDEV, if specified.

*ASP: The storage is allocated for the library from the ASP specified for the ASP parameter.

*ASPGRPPRI: The storage is allocated for the library from the primary ASP of the thread's ASP group.

*SYSTEM: The storage is allocated for the library from the system ASP (ASP 1).

auxiliary-storage-pool-device-name: The storage is allocated for the library from the primary or secondary ASP. The primary or secondary ASP must have been activated (by varying on the ASP device) and have a status of 'Available'.>

TEXT
Specifies the text that briefly describes the library. More information on this parameter is in Commonly used parameters.

*BLANK: Text is not specified.

'description': Specify no more than 50 characters of text, enclosed in apostrophes.

Examples for CRTLIB

Example 1: Adding 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 and object management authority for it. The authority for other users to 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: Adding 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.

Error messages for CRTLIB

*ESCAPE Messages

CPFB8ED
Device description &1 not correct for operation.>
CPF21A0
*AUDIT required to create or change libraries.
CPF210E
Library &1 not available.
CPF2111
Library &1 already exists.
CPF2122
Storage limit exceeded for user profile &1.
CPF2138
Creation of library &3 not allowed.
CPF2166
Library name &1 not valid.>
CPF2172
ASPDEV value not valid with value specified for ASP.>
CPF218A
Library &1 cannot be created into ASP &2.>
CPF218B
Library &1 cannot be created into ASPDEV &2.>
CPF2197
Library &1 cannot be created into user ASP &2.
CPF2283
Authorization list &1 does not exist.
CPF7012
Auxiliary storage pool &4 not found for object &1.
CPF8D05
Library &1 already exists.
CPF9814
Device &1 not found.>
CPF9825
Not authorized to device &1.>
CPF9833
*CURASPGRP or *ASPGRPPRI specified and thread has no ASP group.>