Library lists

Library lists are used by the system to locate objects.

For commands in which a qualified name can be specified, you can omit specifying the library name. If you do so, either of the following happens:

Library lists used by i5/OS™ consist of the following four parts.

System part
The system part of the library list contains objects needed by the system.
Product libraries
Two product libraries may be included in the library list. The system uses product libraries to support languages and utilities that are dependent on libraries other than QSYS to process their commands.

User commands and menus can also specify a product library on the PRDLIB parameter on the Create Command (CRTCMD) and Create Menu (CRTMNU) commands to ensure that dependent objects can be found.

The product libraries are managed by the system, which automatically places product libraries (such as QRPG) into the reserved product library position in the library list when needed. A product library may be a duplicate of the current library or of a library in the user part of the library list.

For example, assume that there is a product library in the library list when a command or menu that has a product library starts. The system will replace the product library in the library list with the new product library until the new command ends or the user leaves the new menu.

Current library
The current library can be, but does not have to be, a duplicate of any library in the library list. The value *CURLIB (current library) may be used on most commands as a library name to represent whatever library has been specified as the current library for the job. If no current library exists in the library list and *CURLIB is specified as the library, QGPL is used. You can change the current library for a job by using the Change Current Library (CHGCURLIB) or Change Library List (CHGLIBL) command.
User part
The user part of the library list contains those libraries referred to by the system's users and applications. The user part, and the product and current libraries, may be different for each job on the system. There is a limit of 250 libraries.

The following diagram shows an example of the structure of the library list:
This diagram shows an example of the structure of the library list.

Note: The system places library QPDA in product library 1 when the source entry utility (SEU) is used. When SEU is being used to syntax check source code, a second product library can be added to product library 2. For example, if you are syntax checking RPG source, then QPDA is product library 1 and QRPG is product library 2. In most other system functions, product library 2 is not used.
Related information
Create Menu (CRTMNU) command
Change Library List (CHGLIBL) command
Create Command (CRTCMD) command
Change Current Library (CHGCURLIB) command
Add Library List Entry (ADDLIBLE) command
Edit Library List (EDTLIBL) command
Remove Library List Entry (RMVLIBLE) command