When we execute a command or call a program, the
AS/400 must know where to find the command or program and the answer is
A Library is a collection of objects.
QSYS is the only library that contains other
A library contain the object name, type, and the
QSYS is the root library where the entire user
defined/ system defined library is created.
System library is the library that contains the
objects that was created at the time OS400 was installed.
System supplied libraries begin with the letter
"Q" or "#".
When you logon the first library to be load is
QSYS. The system library is loaded at the first time.
Library list types:
System library: All IBM supplied library e.g. QSYS, QHLPSYS,
Product Library: Whenever Ibm product is used it is added to the
library automatically and is removed itself when the job completes.
Current Library: Current library is the working library i.e. all
the work done by you is stored in current library. If you want that all the
things done by you should be stored in your personal library ‘AMINEM’ , then
just change the current library as your personal library.
To change current library to your personal library AMINEM: CHGCURLIB AMINEM
User Library: Non-IBM supplied i.e. created by the user.
Ü Related commands:
Display Library List (DSPLIBL)
To display all types of libraries, we can use the command:
In the below snapshot we can see different types of library in the
e.g. SYS(system), CUR(current), USR(user) library.
Display Library List
Type options, press
5=Display objects in
Type Device Text
QSYS SYS System Library
QSYS2 SYS System Library for
QUSRSYS SYS System Library for
QGPL USR General Purpose
LOAD USR Future Three - LOAD
Procedure & Update
F3=Exit F12=Cancel F17=Top
Create Library (CRTLIB)
To create library the command is:
CRTLIB IROBO1 è Press F4
Type choices, press Enter.
. . . . . . . . . . . . IROBO1 Name
type . . . . . . . . . . *TEST (*PROD, *TEST)
'description' . . . . . . . THIS IS IROBO'S TEST LIBRARY
F4=Prompt F5=Refresh F10=Additional parameters F12=Cancel
to use this display F24=More keys
Library type (TYPE)
Database files in production libraries cannot be opened for updating if a
user is in debug mode and he requested that production libraries be protected.
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.
This is a test library. All objects in a test library can be updated
during testing, even if special protection is requested for production
Display library (DSPLIB)
It gives you
the information of all objects that resides in the library with its size.
. . . . . . : IROBO1 Number of objects . :
Type . . . . . . . . : PROD Library ASP number . : 1
Create authority . . : *EXCLUDE Library ASP device . : *SYSBAS
Type options, press Enter.
5=Display full attributes
8=Display service attributes
Object Type Attribute Size Text
PRINT1PGM *PGM RPGLE 131072 rpgle program for pri
ACCOUNT *FILE PF 49152 ACCOUNT RELATED INFOR
PRINT1 *FILE PRTF 4096 PRINTER DDS RLU GENER
QCLSRC *FILE PF 8192 Sources CL-Programs
QDDSSRC *FILE PF 8192 DDS-Sourcen
QRPGLESRC *FILE PF 69632
QRPGLESRC2 *FILE PF
QRPGSRC *FILE PF 8192 SOURCE PHYSICAL FILE
F12=Cancel F17=Top F18=Bottom
Edit Library List (EDTLIBL)
You can add
your personal library to any position just update the sequence no. “0” with the
required where you want your library to be and the corresponding library name.
Edit Library List
Type new/changed information, press
Sequence Sequence Sequence
Number Library Number
Library Number Library
0 150 300
GAMES400 160 310
QGPL 170 320
QTEMP 180 330
40 190 340
50 200 350
60 210 360
70 220 370
80 230 380
90 240 390
Add Library List Entry (ADDLIBLE)
ADDLIBLE LIB(IROBO1) POSITION(*First)
It adds your
personal library at the first position in the library list.
Work With Libraries
Using PDM (WRKLIBPDM)