21
1 Week # 3 AS/400 Library List When you need to use any system object or an object that you have created, the system usually searches for the object in your library list (unless the job is qualified). A library list is : The the path of libraries a job searches when trying to find programs, files, or other AS/400 objects named in that job which may be either a command- type job or a program-type job.

1 Week # 3 AS/400 Library List When you need to use any system object or an object that you have created, the system usually searches for the object in

Embed Size (px)

Citation preview

Page 1: 1 Week # 3 AS/400 Library List When you need to use any system object or an object that you have created, the system usually searches for the object in

1

Week # 3AS/400 Library List

When you need to use any system object or an object that you have created, the system usually searches for the object in your library list (unless the job is qualified).

A library list is:The the path of libraries a job searches when trying to find programs, files, or other AS/400 objects named in that job which may be either a command-type job or a program-type job.

Page 2: 1 Week # 3 AS/400 Library List When you need to use any system object or an object that you have created, the system usually searches for the object in

2

Week # 3AS/400 Library List (Continued)

A library list is usually acquired for each job from a job description. This default library list is determined at sign-on time and can be used during the entire session.

In the common case of an object name being required as a parameter (e.g., the CPYF command’s From file parameter), the library part of the object name typically defaults to *LIBL, which means the library list of that job.

An interactive or batch job’s library list contains the names of a limited number of libraries to which a user needs access. The library list can be changed while the job is running by various CL commands (i.e. CHGLIBL).

Page 3: 1 Week # 3 AS/400 Library List When you need to use any system object or an object that you have created, the system usually searches for the object in

3

Week # 3AS/400 Library List (Continued)

A library list consists of four parts:Part of library list Examples of contentSystem (up to 15) QSYS

QHLPSYSQUSRSYS

Product (none, 1, or 2) QPDAQRPG

Current (1 only) JSMITH (created by programmer J. Smith)

User (up to 25*) QGPLQTEMPPAYLIB (a user library for payroll

programs)

Page 4: 1 Week # 3 AS/400 Library List When you need to use any system object or an object that you have created, the system usually searches for the object in

4

Week # 3System Library List

The system library list: Contains up to 250 libraries. You can determine which libraries will

be placed in the system portion of your library list by looking at the system value QSYSLIBL.

Page 5: 1 Week # 3 AS/400 Library List When you need to use any system object or an object that you have created, the system usually searches for the object in

5

Week # 3System Library List (Continued)

The shipped system libraries should include the following:

QSYS -- contains essential system objects, such as system programs and commands. QSYS2 -- contains additional system programs and filesQHLPSYS -- contains all the Help information for different screens, including the Search Index informationQUSRSYS -- contains other IBM-supplied objects needed for various system functions, as well as user message queues for holding messages

Page 6: 1 Week # 3 AS/400 Library List When you need to use any system object or an object that you have created, the system usually searches for the object in

6

Week # 3Product Library

The operating system inserts a product library when the library is needed for some task a user has requested.

Example: If a user requests compilation of an RPG program, the library containing the necessary translator programs, QRPG, is inserted as a product library during the compile process and then removed when the process is finished; this adding and removing of appropriate product libraries is automatic.

Page 7: 1 Week # 3 AS/400 Library List When you need to use any system object or an object that you have created, the system usually searches for the object in

7

Week # 3Current Library

The current library is:A specially designated user library which is usually assigned in the user profile.

A specified current library follows the product library in the library list.

The current library is significant because it is searched before other user libraries when an object is requested.

Page 8: 1 Week # 3 AS/400 Library List When you need to use any system object or an object that you have created, the system usually searches for the object in

8

Week # 3User Library List

The user library list: Contains libraries that organize programs,

screens, data files, and application code that users need

Can contain up to 250 library names* Can be customized for each user. Can be customized by using a special job

description, by running an initial start-up program at sign-on, or by executing CL commands when needed as the job is run

Page 9: 1 Week # 3 AS/400 Library List When you need to use any system object or an object that you have created, the system usually searches for the object in

9

Week # 3User Library List (Continued)

Several IBM-supplied libraries, which begin with the letter Q, are included in the user list.

For example, QGPL, QTEMP. (QTEMP is actually a temporary User library only available during a given session and not accessible to any other User).

Page 10: 1 Week # 3 AS/400 Library List When you need to use any system object or an object that you have created, the system usually searches for the object in

10

Week # 3Objects Within Libraries

Regarding the relationship among objects, libraries, and AS/400 Library List:

When objects are created, they must be "placed in" (associated with) a library. This association is logical -- object storage locations are assigned by the system; objects are not physically stored within a library area on disk.

Page 11: 1 Week # 3 AS/400 Library List When you need to use any system object or an object that you have created, the system usually searches for the object in

11

Week # 3Objects Within Libraries (Continued)

If no current library is designated, the default IBM-supplied user library QGPL is used.

Unless you qualify a job, the system searches the library list for requested objects. This is the meaning of *LIBL as the Library value for an object name in most CL commands.

The library list is searched in the following order: current library, system libraries, product libraries, and user libraries. Libraries are searched in the order specified in the library list, from top to bottom.

Page 12: 1 Week # 3 AS/400 Library List When you need to use any system object or an object that you have created, the system usually searches for the object in

12

Week # 3Objects Within Libraries (Continued)

The needs of the individual user determine the libraries included in the user library list.

Every individual user on the system may have a unique, personally tailored library list. More commonly, groups of users with similar work requirements have the same or a similar library list with, perhaps, only the current library being unique.

Page 13: 1 Week # 3 AS/400 Library List When you need to use any system object or an object that you have created, the system usually searches for the object in

13

Week # 3Library-List Commands

Library-List Commands let you:

Work with a library list

Add or remove libraries

to/from the list

Change the order of libraries in

the list

Page 14: 1 Week # 3 AS/400 Library List When you need to use any system object or an object that you have created, the system usually searches for the object in

14

Week # 3The DSPLIBL Command

DSPLIBL (Display Library List) command

Allows you to check the current contents of the library list.

Requires no parameters Displays your job’s current library list on the

workstation screen

Remember: Contents of a library list may differ from one (user’s) job to another.

Page 15: 1 Week # 3 AS/400 Library List When you need to use any system object or an object that you have created, the system usually searches for the object in

15

Week # 3The CHGCURLIB Command

Among other commands, the CHGCURLIB (Change Current Library) command lets you specify a different library to occupy the spot of the current library in your library list.

The only required parameter value for this command is the name of the library that will become the new current library.

Page 16: 1 Week # 3 AS/400 Library List When you need to use any system object or an object that you have created, the system usually searches for the object in

16

Week # 3The CHGCURLIB Command (Continued)

Important when using the CHGCURLIB command:The old current library is not added to the user part of the list. It is removed from the list altogether. For this reason, this command would not be best if you wanted to change the relative order of libraries already in the user part of the library list.

Page 17: 1 Week # 3 AS/400 Library List When you need to use any system object or an object that you have created, the system usually searches for the object in

17

Week # 3The ADDLIBLE & RMVLIBLE Commands

The ADDLIBLE (Add Library List Entry) command lets you add a new library to the user-library portion of the library list.

This command affects only the user part of the library list.

If you needed to remove a single library from the user library list, use RMVLIBLE (Remove Library List Entry) command, specifying by name the library to be removed.

Page 18: 1 Week # 3 AS/400 Library List When you need to use any system object or an object that you have created, the system usually searches for the object in

18

Week # 3The CHGLIBL Command

The CHGLIBL (Change Library List) command lets you add, remove, or change the order of libraries in your user library list and change the current library if so desired.

Remember: The system searches the library list from top to bottom, so you might need to move a library higher in the list.

Page 19: 1 Week # 3 AS/400 Library List When you need to use any system object or an object that you have created, the system usually searches for the object in

19

Week # 3The CHGLIBL Command (Continued)

Each library name is an entry field that can be typed over (to replace with a different library name) or add new libraries by entering a plus (+) sign in the “+ for more values” field.

Without re-typing, you can insert a new user library into the list just before an existing library by typing a greater than symbol (>) over the first letter of the existing library name and then pressing the Field exit key followed by the Enter key.

Page 20: 1 Week # 3 AS/400 Library List When you need to use any system object or an object that you have created, the system usually searches for the object in

20

Week # 3The CHGLIBL Command (Continued)

To change the current library, type over the Current library value displayed on the screen and replace it with the desired library name.

The CHGLIBL command requires you to re-type names to change the order of libraries, but you can use the command from within a CL program both interactively as well as batch.

Page 21: 1 Week # 3 AS/400 Library List When you need to use any system object or an object that you have created, the system usually searches for the object in

21

Week # 3The EDTLIBL Command

The EDTLIBL command lets you Work on multiple libraries Add libraries to your library list and/or change the

relative order of the libraries by renumbering the list

This command is the easiest to use for changing the order of user libraries in an interactive job.

You don’t need to re-type library names -- just change their sequence numbers.

When you press Enter, the command is executed, changing the order of the libraries.