fhg
Volume 6, Number 24 -- June 21, 2006

Reader Feedback on Setting Library Lists

Published: June 21, 2006

by Joe Hertvik

For my column on How to Set i5 Library Lists for 5250 and Batch Jobs, several readers immediately wrote in to ask questions, provide more information, and even to question why I would cover such a basic topic. Let's take a look at some of the feedback I received on that column and see what else it teaches us about library lists.


Hey, Joe:

You seemed to indicate that a user program cannot utilize the Product Library list feature in a library list, but I've found that you can configure an individual command to create a Product Library list entry whenever that command is executed. This is done when you create or change a command by using either the Create Command (CRTCMD) or Change Command (CHGCMD) commands.

There is a parameter for i5/OS and OS/400 command objects called Product Library (PRDLIB), which is updated by using CRTCMD or CHGCMD. When you run a command with a valid library name in the PRDLIB parameter, i5/OS adds that PRDLIB value as a Product Library list entry into the user's library list, and that library remains in their library list until the command finishes running. Once the command ends, the library is removed from the list. I frequently use this technique to insert a library into the Product Library list for my utility commands.

--R.D.


This is a cool technique that I tested out by creating a simple command in my shop that uses the UTILLIB library as its product library. I first created the command by using the following CRTCMD command on my i5 partition.

CRTCMD CMD(command_lib/command_name) PGM(program_lib/command_pgm) SRCFILE(source_lib/QCMDSRC) PRDLIB(UTILLIB)

Note that I entered UTILLIB into the Product Library parameter (PRDLIB). This tells i5/OS that when this command starts running, it should insert UTILLIB into a Product List entry for the user's library list.

Then I ran the command and, while inside the command screens, I performed a system request-3 (Display Job) and took option 13, Display Library List, if active, to view my library list. Sure enough, the UTILLIB library was now added to my library list as a Product Library list entry (type 'PRD'). Once I exited the command, UTILLIB was removed from the list, which I again verified by taking option 13 inside the Display Job function.

Next, I attempted to change the Product Library list entry for that command to another library named LIB2. I did this by running the following Change Command statement:

CHGCMD CMD(command_lib/command_name) PRDLIB(LIB2)

I then ran the command again and, as advertised, LIB2 was now in the Product Library list instead of UTILLIB. Once I exited the command, LIB2 was removed from my library list.

So the technique works pretty well for allowing your commands to tell i5/OS and OS/400 what product library they need. What I like about it is that it doesn't junk up your system or user library lists with additional libraries, and it cleans up after itself by removing the product library from your lib list when it's done. Give it a try. You'll like it.

One final note on using CRTCMD and CHGCMD to modify library lists. These commands also contain a Current Library parameter (CURLIB) that allows you to change the user's current library while they execute a command, similar to how you modify Product Library list entries when a command starts. So you can also modify your commands to change their current libraries on the fly.


Hey, Joe:

In your article, you said that "The job's current library is the first user library in the list." If the following conditions occur, can you tell me which library is the first library searched in the user part of my library list?

  • I set *CRTDFT in the Current Library parameter (CURLIB) of the user profile; and
  • I set the user library list by entering a library list in the job description attached to the user profile, and the first library in the job description library list is LIB1

I also understand from your article that the current library is used as the default library for accessed commands and objects that designate *CURLIB as their library value. So which library would be my default *CURLIB value if the user profile designates *CRTDFT as its user profile Current Library parameter?

--Ken


To take your questions in order, LIB1 would always be the first library searched in the user part of your library list when CURLIB is equal to *CRTDFT. This is because, by default, there is no current library entry specified in a user's library list when the CURLIB parameter of the user profile contains the *CRTDFT value. To prove this, if you display the library list for a user who has a *CRTDFT Current Library value; that library list will not contain a type 'CUR' library entry.

Regarding which library is used for operations that designate *CURLIB as their library value when the user profile contains *CRTDFT in its CURLIB parameter, the QGPL library is always used as the default current library in that situation. So *CURLIB would be set to QGPL for your second question.


Hey, Joe:

It's interesting that you needed to dedicate an article to Library Lists. I realize that i5/OS newcomers may not be aware of the nitty gritty details of lib lists and that a refresher course is helpful, but the tone of the article seemed aimed at administrators who didn't know anything about library lists. Has the system slipped so far toward the Dark Side (that is, the PC side) that understanding library lists is now arcane knowledge? Or has the i5 educational process slipped so far that "Library Lists 101" is no longer required reading? Just curious.

--Paul


I understand your sentiment but, yes, it's true. There are people who are in charge of i5, iSeries, and AS/400 machines who haven't had any training on library lists. And worse, I found that there didn't seem to be any good free primers out there. It seemed that many of the library list articles I found assumed that the readers already knew everything about library lists. Hence, my attempt at a basic library list article, which was aimed at a knowledgeable system administrator who didn't grow up in an OS/400 and i5 environment. While it might not be your cup of tea, it's my hope that there are some people who can benefit from it.

HTH.

--Joe


RELATED STORY

How to Set i5 Library Lists for 5250 and Batch Jobs



Sponsored By
COMMON

COMMON Fall 2006
IT Education Conference & Expo
Miami Beach, Florida
September 17-21, 2006

Register Now!

COMMON is the world's largest community of IBM midrange users providing information, education and networking for end-users. COMMON is hosting its Fall 2006 IT Education Conference & Expo in Miami Beach, Florida, September 17-21, and will feature a host of sessions and hands-on labs covering business strategy, database, systems management, networking and development, with a featured educational focus on Disaster Recovery. Take advantage of the real-world technical education, best-practice sharing with fellow iSeries users, and access to IBM executives and developers that you can't find anywhere else!

Conference Highlights
· Choose from hundreds of sessions organized by specific Courses of Study to help
      you find the technical information you need.
· Explore the latest technology solutions in the industry's largest iSeries-related Expo.
· Network with like-minded peers at COMMON social events.
· Speak directly with IBM executives at the iSeries Town Hall Meeting and take
      advantage of multiple opportunities to talk with the IBM experts who build the
      technology that you use every day.

COMMON education is one of the most cost-effective ways to gain the tools and knowledge you need to meet the changing demands of information technology. You'll receive education unlike any offered within the industry that will enable you to garner a tangible and immediate return on your investment. In fact, more than 95% of COMMON Spring 2005 attendees said they gained information from sessions that was of immediate value when they returned to work.

In addition to the direct savings on education, conference attendees make lasting career connections with other iSeries professionals whom they can consult long after the conference ends. Attendees will also have direct access to IBM developers and managers. The Expo offers an opportunity to talk one-on-one with industry vendors who provide the latest products and services. This means attendees return to the office with real-time solutions that can be implemented immediately--without wasting countless hours in independent research.

For more information on COMMON and to register, please visit:
www.common.org



Senior Technical Editor: Ted Holt
Technical Editors: Howard Arner, Joe Hertvik, Shannon O'Donnell, Kevin Vandever
Contributing Technical Editors: Joel Cochran, Wayne O. Evans, Raymond Everhart,
Bruce Guetzkow, Brian Kelly, Marc Logemann, David Morris
Publisher and Advertising Director: Jenny Thomas
Advertising Sales Representative: Kim Reed
Contact the Editors: To contact anyone on the IT Jungle Team
Go to our contacts page and send us a message.

Sponsored Links

iTera:  High availability solution for $50 a day - includes IBM System i5 Hardware
COMMON:  Join us at the Fall 2006 conference, September 17-21, in Miami Beach, Florida
LANSA:  An entirely different approach to application modernization and innovation

 


 
Subscription Information:
You can unsubscribe, change your email address, or sign up for any of IT Jungle's free e-newsletters through our Web site at http://www.itjungle.com/sub/subscribe.html.

Copyright © 1996-2008 Guild Companies, Inc. All Rights Reserved.
Guild Companies, Inc., 50 Park Terrace East, Suite 8F, New York, NY 10034

Privacy Statement