CHGLIB (Change Library)

CHGLIB Command syntax diagram

 

Purpose

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

 

Restrictions

  1. You must have *OBJMGT authority to the library that is changed.
  2. You must have *AUDIT special authority to specify a value other than *SAME on the CRTOBJAUD parameter. To change only the CRTOBJAUD parameter, only *AUDIT special authority is required.

 

Required Parameters

LIB
Specifies the name of the library to be changed.

*CURLIB: The current library for the job is changed. If no library is specified as the current library for the job, the QGPL library is used.

library-name: Specify the name of the library to be changed.

 

Optional Parameters

TYPE
Specifies the new library type.

*SAME: The value does not change.

*PROD: This is a production library. Database files in production libraries are not opened for updating if a user is in debug mode and he requested 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 are updated during testing, even if special protection is requested for production libraries.

TEXT
Specifies the text that briefly describes the library and its function. More information is in Commonly used parameters.

*SAME: The value does not change.

*BLANK: Text is not specified.

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

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

*SAME: The value does not change.

*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 can also 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.

*SAME: The value does not change.

*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.

Example for CHGLIB

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 for CHGLIB

*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.
CPF9810
Library &1 not found.
CPF9820
Not authorized to use library &1.
CPF9830
Cannot assign library &1.