• The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
Menu
  • The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
  • Reader Feedback on Setting Library Lists

    June 21, 2006 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

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Tags:

    Sponsored by
    ARCAD Software

    Embrace VS Code for IBM i Development

    The IBM i development landscape is evolving with modern tools that enhance efficiency and collaboration. Ready to make the move to VS Code for IBM i?

    Watch this webinar where we showcase how VS Code can serve as a powerful editor for native IBM i code and explore the essential extensions that make it possible.

    In this session, you’ll discover:

    • How ARCAD’s integration with VS Code provides deep metadata insights, allowing developers to assess the impact of their changes upfront.
    • The role of Git in enabling seamless collaboration between developers using tools like SEU, RDi, and VS Code.
    • Powerful extensions for code quality, security, impact analysis, smart build, and automated RPG conversion to Free Form.
    • How non-IBM i developers can now contribute to IBM i projects without prior knowledge of its specifics, while ensuring full control over their changes.

    The future of IBM i development is here. Let ARCAD be your guide!

    Watch the replay now!

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    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

    System i Helps Catholic Charities Spend Its Money on the Needy IBM Reverses Course, Keeps S/3X Compilers in i5/OS V5R5

    Leave a Reply Cancel reply

Volume 6, Number 24 -- June 21, 2006
THIS ISSUE SPONSORED BY:

ProData Computer Services
WorksRight Software
COMMON

Table of Contents

  • Guru Readers Contribute Their Favorite SEU Tips
  • Autostarting WAS 6.0 on the System i
  • Reader Feedback on Setting Library Lists

Content archive

  • The Four Hundred
  • Four Hundred Stuff
  • Four Hundred Guru

Recent Posts

  • POWERUp 2025 –Your Source For IBM i 7.6 Information
  • Maxava Consulting Services Does More Than HA/DR Project Management – A Lot More
  • Guru: Creating An SQL Stored Procedure That Returns A Result Set
  • As I See It: At Any Cost
  • IBM i PTF Guide, Volume 27, Number 19
  • IBM Unveils Manzan, A New Open Source Event Monitor For IBM i
  • Say Goodbye To Downtime: Update Your Database Without Taking Your Business Offline
  • i-Rays Brings Observability To IBM i Performance Problems
  • Another Non-TR “Technology Refresh” Happens With IBM i TR6
  • IBM i PTF Guide, Volume 27, Number 18

Subscribe

To get news from IT Jungle sent to your inbox every week, subscribe to our newsletter.

Pages

  • About Us
  • Contact
  • Contributors
  • Four Hundred Monitor
  • IBM i PTF Guide
  • Media Kit
  • Subscribe

Search

Copyright © 2025 IT Jungle