Presentation on theme: "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."— Presentation transcript:
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.
2 Week # 3 AS/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 commands 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 jobs 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).
3 Week # 3 AS/400 Library List (Continued) A library list consists of four parts: Part of library listExamples of content System (up to 15)QSYS QHLPSYS QUSRSYS Product (none, 1, or 2)QPDA QRPG Current (1 only)JSMITH (created by programmer J. Smith) User (up to 25*)QGPL QTEMP PAYLIB (a user library for payroll programs)
4 Week # 3 System 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.
5 Week # 3 System 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 files QHLPSYS -- contains all the Help information for different screens, including the Search Index information QUSRSYS -- contains other IBM-supplied objects needed for various system functions, as well as user message queues for holding messages
6 Week # 3 Product 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.
7 Week # 3 Current 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.
8 Week # 3 User 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
9 Week # 3 User 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).
10 Week # 3 Objects 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.
11 Week # 3 Objects 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.
12 Week # 3 Objects 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.
13 Week # 3 Library-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
14 Week # 3 The DSPLIBL Command DSPLIBL (Display Library List) command Allows you to check the current contents of the library list. Requires no parameters Displays your jobs current library list on the workstation screen Remember: Contents of a library list may differ from one (users) job to another.
15 Week # 3 The 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.
16 Week # 3 The 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.
17 Week # 3 The 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.
18 Week # 3 The 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.
19 Week # 3 The 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.
20 Week # 3 The 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.
21 Week # 3 The 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 dont 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.