CIS 808 Special Topics: AS/400 Lesson 3 - Library Commands lesson-03.doc

Bodnovich page 6 of 6

Libraries

·  System up to 15; used by system, we don’t modify these

·  Product 0,1, or 2; inserted when needed for a task, i.e., compiling an RPG program

·  Current 1; default library into which most newly created objects are placed

·  User up to 25; programs, screens, data files, and applications required to do business on the system

DSPLIBL

Display Library List
System: S1010045
Type options, press Enter.
5=Display objects in library
Opt Library Type Text
___ QSYS SYS System Library
___ QSYS2 SYS System Library for CPI's
___ QHLPSYS SYS
___ QUSRSYS SYS
___ TOM CUR Tom Bodnovich's library '
___ QGPL USR General Purpose Library
___ QTEMP USR
Bottom
F3=Exit F12=Cancel F17=Top F18=Bottom


CHGCURLIB

allows us to change the current library.

Change Current Library (CHGCURLIB)
Type choices, press Enter.
Current library ...... Name, *CRTDFT
Bottom
F3=Exit F4=Prompt F5=Refresh F12=Cancel F13=How to use this display
F24=More keys
Parameter CURLIB required.

Chgcurlib will make a new library the current library and remove the prior one from the list.

Change Current Library (CHGCURLIB)
Type choices, press Enter.
Current library ...... RPGSHARE Name, *CRTDFT
Bottom
F3=Exit F4=Prompt F5=Refresh F12=Cancel F13=How to use this display
F24=More keys
Parameter CURLIB required.
Display Library List
System: S1010045
Type options, press Enter.
5=Display objects in library
Opt Library Type Text
___ QSYS SYS System Library
___ QSYS2 SYS System Library for CPI's
___ QHLPSYS SYS
___ QUSRSYS SYS
___ RPGSHARE CUR library shared by students in RPG class
___ QGPL USR General Purpose Library
___ QTEMP USR
Bottom
F3=Exit F12=Cancel F17=Top F18=Bottom

the prior current library, TOM, is removed from the list.

?? what can you do if you still want to access files in the old current library ??

ans: ADDLIBLE to add it as a user library

?? How can we rearrange the order of the library list or

how can we delete a library from the list ??

ans: EDTLIBL, this will change the User Library List.

Edit Library List
Type new/changed information, press Enter.
To add a library, type name and desired sequence number.
To remove a library, space over library name.
To change position of a library, type new sequence number.
Sequence Sequence Sequence
Number Library Number Library Number Library
010 120 230
020 QGPL 130 240
030 QTEMP 140 250
040 150
050 160
060 170
070 180
080 190
090 200
100 210
110 220
F3=Exit F5=Refresh F12=Cancel

CHGSYSLIBL can be used to change the system library list. This command requires special priveleges.


Locating Objects

*** refer to figure 3.12 ***

MAIN AS/400 Main Menu
System: S1010045
Select one of the following:
1. User tasks
2. Office tasks
3. General system tasks
4. Files, libraries, and folders
5. Programming
90. Sign off
Selection or command
===> CALL MISSINGPGM
F3=Exit F4=Prompt F9=Retrieve F12=Cancel F13=Information Assistant
F23=Set initial menu
Program MISSINGPGM library *LIBL not found.
MAIN AS/400 Main Menu
System: S1010045
Select one of the following:
1. User tasks
2. Office tasks
3. General system tasks
4. Files, libraries, and folders
5. Programming
90. Sign off
Selection or command
===> CHGSYSLIBL
F3=Exit F4=Prompt F9=Retrieve F12=Cancel F13=Information Assistant
F23=Set initial menu
Not authorized to command CHGSYSLIBL in library *LIBL
Work with All Output Queues
Type options, press Enter.
2=Change 3=Hold 4=Delete 5=Work with 6=Release 8=Description
9=Work with Writers 14=Clear
Opt Queue Library Files Writer Status
__ QDKT QGPL 0 RLS
__ QPFROUTQ QGPL 0 RLS
14 QPRINT QGPL 0 RLS
__ QPRINTS QGPL 0 RLS
Bottom
===>
F3=Exit F4=Prompt F5=Refresh F12=Cancel F24=More keys
Work with All Output Queues
Type options, press Enter.
2=Change 3=Hold 4=Delete 5=Work with 6=Release 8=Description
9=Work with Writers 14=Clear
Opt Queue Library Files Writer Status
__ QDKT QGPL 0 RLS
__ QPFROUTQ QGPL 0 RLS
14 QPRINT QGPL 0 RLS
__ QPRINTS QGPL 0 RLS
Bottom
===>
F3=Exit F4=Prompt F5=Refresh F12=Cancel F24=More keys
Not authorized to use object QPRINT in library QGPL type *OUTQ.


Storing Objects

*** refer to figure 3.14 ***

Creating Objects

objects can be created with the CRTxxx command.

placed by default in current library

CRTSRCPF - defaults to current library, as do most create commands

CRTOUTQ - creates output queue for program output. QPRINT is already created, your programs may print to this queue or you must define some other queue.

When a current library is not specified, then most objects default to the QGPL library (general purpose library)

exceptions

CRTLIB (object of *LIB)

CRTUSRPRF (object of *USRPRF)