Change Library (CHGLIB)

The Change Library (CHGLIB) command can change the type attribute, the text description, the default create authority value, or the default object auditing value of a library.

If the library being changed is currently journaled, entries are deposited to the journal recording the change.

Use the Display Library Description (DSPLIBD) command to display journal information for the library. Refer to the Start Journal Library (STRJRNLIB) command for more information about journaling a library.

Note: For additional information regarding journaling, see the Journal management topic collection in the IBM i Information Center at http://www.ibm.com/systems/i/infocenter/.

Restrictions:

  1. To specify a value other than *SAME for the Create object auditing (CRTOBJAUD) parameter you must have audit (*AUDIT) special authority.
  2. To specify only the CRTOBJAUD parameter to be changed, only *AUDIT special authority is required. To specify any other parameter to be changed, you must have object management (*OBJMGT) authority for the library to be changed.

Note: If you do not specify at least one of the Library type (TYPE), Text 'description' (TEXT), Create authority (CRTAUT), or Create object auditing (CRTOBJAUD) parameters, completion message CPC2105 is sent to indicate that the library was not changed.

Parameters

Keyword Description Choices Notes
LIB Library Name, *CURLIB Required, Key, Positional 1
TYPE Library type *SAME, *PROD, *TEST Optional, Positional 2
TEXT Text 'description' Character value, *SAME, *BLANK Optional
CRTAUT Create authority Name, *SAME, *SYSVAL, *CHANGE, *ALL, *USE, *EXCLUDE Optional
CRTOBJAUD Create object auditing *SAME, *SYSVAL, *NONE, *USRPRF, *CHANGE, *ALL Optional

Library (LIB)

Specifies the library to be changed.

This is a required parameter.

*CURLIB
The current library for the thread is the library to be changed. If no current library exists in the library list for the current thread, the QGPL library is changed.
name
Specify the name of the library to be changed.

Library type (TYPE)

Specifies the new library type.

*SAME
The TYPE attribute of the library remains the same.
*PROD
This is a production library. Database files in production libraries are not opened for updating if a user is in debug mode and requested that production libraries be protected. A user can protect all database files in production libraries from updates by specifying *NO for the Update production files (UPDPROD) parameter 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 are updated during testing, even if special protection is requested for production libraries.

Text 'description' (TEXT)

Specifies the text that briefly describes the object.

*SAME
The text, if any, remains unchanged.
*BLANK
The text is set to blanks.
'description'
Specify no more than 50 characters of text, enclosed in apostrophes.

Create authority (CRTAUT)

Specifies the default public authority for an object created into this library. This is the authority given to a user who does not have specific authority for the object, who is not on an authorization list specified for the object, and whose user groups have no specific authority for the object.

When the user creates an object into this library, the Authority (AUT) parameter on the create command for the object determines the public authority for the object. If the AUT value on the create command for the object is *LIBCRTAUT, the public authority for the object is set to the CRTAUT value for the library.

*SAME
The default public authority value does not change.
*SYSVAL
The default public authority will be determined by the value of the QCRTAUT system value when an object is created into this library.
*CHANGE
The user can perform all operations on the object except those limited to the owner or controlled by object existence (*OBJEXIST) and object management (*OBJMGT) authorities. The user can change and perform basic functions on the object. *CHANGE authority provides object operational (*OBJOPR) authority and all data authority. If the object is an authorization list, the user cannot add, change, or remove users.
*ALL
The user can perform all operations except those limited to the owner or controlled by authorization list management (*AUTLMGT) 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 object.
*USE
The user can perform basic operations on the object, such as running a program or reading a file. The user cannot change the object. Use (*USE) authority provides object operational (*OBJOPR), read (*READ), and execute (*EXECUTE) authorities.
*EXCLUDE
The user cannot access the object.
authorization-list-name
Specify the name of the authorization list whose authority is used for the object.

Create object auditing (CRTOBJAUD)

Specifies the auditing value for objects created in this library.

*SAME
The value does not change.
*SYSVAL
The auditing value will be determined by the value of the QCRTOBJAUD system value when an object is created into this library.
*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 to the security journal for the access. The Object auditing value (OBJAUD) parameter on the Change User Auditing (CHGUSRAUD) command is used to turn on auditing for a specific user.
*CHANGE
All change access to this object by all users will cause an audit entry to be sent to the security journal.
*ALL
All change or read access to this object by all users will cause an audit entry to be sent to the security journal.

Examples

CHGLIB   LIB(LIB1)  TYPE(*TEST)  TEXT('NEW TEXT FOR LIB1')

This command changes the TYPE attribute of the library named LIB1 to *TEST and changes the text description to the value specified by the TEXT parameter.

Error messages

*ESCAPE Messages

CPF21A0
*AUDIT required to create or change libraries.
CPF210C
Library &1 not changed.
CPF2150
Object information function failed.
CPF2151
Operation failed for &2 in &1 type *&3.
CPF2283
Authorization list &1 does not exist.
CPF7003
Entry not journaled to journal &1. Reason code &3.
CPF9810
Library &1 not found.
CPF9820
Not authorized to use library &1.
CPF9830
Cannot assign library &1.