Change Library List (QLICHGLL) API


  Required Parameter Group:

1 Current library name Input Char(11)
2 First product library name Input Char(11)
3 Second product library name Input Char(11)
4 User library list names Input Array(*) of Char(11)
5 Number of user library names Input Binary(4)
6 Error code I/O Char(*)

  Default Public Authority: *USE

  Threadsafe: Yes

The Change Library List (QLICHGLL) API changes the current library, the two product libraries, and the user part of the current thread's library list. This API provides the only way to change the two product libraries in the library list. The only other way to change the product libraries is using the Create Command (CRTCMD) or the Create Menu (CRTMNU) command.

When the initial thread's library list is changed, each library added to the list may be locked with a shared-read lock. The value of the QLIBLCKLVL system value determines whether libraries in the library list are locked. If a library is being removed from the initial thread's library list, and it was locked when it was added to the library list, the shared-read lock is released. When a secondary thread's library list is changed, libraries added to the library list are not locked.

Authority to the library is checked whenever a library name is specified on one of the required parameters.

You may want to save the current thread's library list before changing it. The QWCRTVCA API can be used to retrieve the current thread's library list. The Retrieve Job Information (QUSRJOBI) API can be used to retrieve the initial thread's library list, when the current thread is not the initial thread. You can then change the library list back to its original value by using the QLICHGLL API with the libraries saved from the QUSRJOBI or QWCRTVCA API.


Authorities and Locks

Library Authority
*USE
Library Lock
*SHRRD (initial thread only)
The QLIBLCKLVL system value determines whether libraries in the library list are locked.

Required Parameter Group

Current library name
INPUT;CHAR(11)

The library that replaces the current library in the library list. (The data is left-justified with a blank at the end.)

The current library can be, but does not have to be, a duplicate of any library in the library list. QTEMP cannot be specified for the library name.

The following special values can be used:

*CRTDFT No library should be in the current library entry in the library list. If objects are created into the current library, then library QGPL is used as the current default library.
*SAME The current library in the library list is not changed.

First product library name
INPUT;CHAR(11)

The library that replaces the first product library entry in the library list. (The data is left-justified with a blank at the end.)

A product library may be a duplicate of the current library or of a library in the user part of the library list. QTEMP cannot be specified for the library name.

The following special values can be used:

*NONE The first product library entry in the library list is removed.
*SAME The first product library entry in the library list is not changed.

Second product library name
INPUT;CHAR(11)

The library that replaces the second product library entry in the library list. (The data is left-justified with a blank at the end.) QTEMP cannot be specified for the library name.

The following special values can be used:

*NONE The second product library entry in the library list is removed.
*SAME The second product library entry in the library list is not changed.

User library list names
INPUT; ARRAY(*) of CHAR(11)

The libraries that replace the libraries in the user part of the library list. Specify the names of the libraries in the order in which they are to be searched. (The data is left-justified with a blank at the end.)

The same library name cannot be specified more than once. A library cannot exist in the system part and the user part of the library list.

Number of user library names
INPUT;BINARY(4)

The total number of library names that will be changed in the user part of the library list.

This must be a value from -1 through 250. There is a limit of 250 libraries in the user part of the library list. When either of the following values is specified, the user library list names parameter is ignored:

-1 The user part of the library list remains the same.
0 All libraries in the user part of the library list are removed.

Error code
I/O; CHAR(*)

The structure in which to return error information. For the format of the structure, see Error code parameter.


Error Messages

Message ID Error Message Text
CPF2106 E Library list not changed.
CPF2110 E Library &1 not found.
CPF2113 E Cannot allocate library &1.
CPF2133 E First product library on library list destroyed.
CPF2134 E Second product library on library list destroyed.
CPF2137 E Current library on library list destroyed.
CPF2176 E Library &1 damaged.
CPF2182 E Not authorized to library &1.
CPF2184 E Library list not replaced.
CPF219A E Library QTEMP cannot be specified.
CPF219F E Number of libraries for library list not valid.
CPF24B4 E Severe error while addressing parameter list.
CPF3C90 E Literal value cannot be changed.
CPF3CF1 E Error code parameter not valid.
CPF9872 E Program or service program &1 in library &2 ended. Reason code &3.


API introduced: V2R3

[ Back to top | Object APIs | APIs by category ]