Set Your Library List From A Job Description
August 18, 2015 Ted Holt
Note: The code accompanying this article is available for download here.
On August 4, 2015, I asserted that the proper residence of a library list is a job description. Talk is cheap. Now it’s time for me to put my money where my mouth is. I have a utility that gives me easy access to the library lists in job descriptions. I wrote this utility last year, and now I use it daily with great results. Today I make that utility freely available for you to use in your shop.
If I were to follow IBM’s naming convention, I would probably call my utility CHGLIBLFRMJOBD, but that name exceeds the 10-character limit, and besides, it’s too much to type. I call the utility LLJD, and it consists of three objects:
It also uses Brian Rusch’s magnificent commands MOVPGMMSG and RSNESCMSG. If you missed those, see the link in the related stories below.
LLJD accepts two parameters:
Job descriptions don’t define a current library, but leaving a current library in the library list can produce undesirable results, so I added the second parameter.
Here’s an example:
LLJD JOBD(QGPL/MYJOBD) CURLIB(MYLIB)
The JOBD parameter tells the system to set the user portion of the current job to the library list found in job description MYJOBD in library QGPL, and also to set the current library to MYLIB.
Both parameters default to a value of *USRPRF, which means that LLJD should set the library list and current library to the values that are assigned to the current user profile. Therefore, entering LLJD without any parameters is a quick way to reset an interactive job to the values it had at sign-on.
As with all code that you get from others, test thoroughly and use at your own risk. If you find bugs or have suggestions for enhancements, please let me know.