Library lists and submit jobs -- AS400

Viewed 1432

I am adding a library to my library list in PGM A and submitting a job PGM B. PGM B submits a job PGM C. However while debugging pgm C, I notice that the library list does not show that particular library that I added in PGM A. So my question is, does that library need to be added to my LIBL again in PGM C and does the library list change with every new job submitted?

3 Answers

By default the library list is set to user profile job description on the SBMJOB command. These are 2 methods to override:

  • Change "Initial Library List" and/or "Curent library" parms (INLLIBL and CURLIB) on the SBMJOB command.
  • Create a job description specifically for this and similar jobs. I'd duplicate job description QGPL/QBATCH and modify the copy. Then specify that on the "Job description" parm (JOBD) of the SBMJOB command

A)

The SBMJOB command normally defaults to INLLIBL(*CURRENT) CURLIB(*CURRENT). Those are the values for using the settings of the submitting job, as you desire. Prompt the command with [F4] to make sure that the defaults have not been changed on your system. In either event, you can specify those values on the SBMJOB commands in your programs, to ensure that will be what happens.

SBMJOB ...  INLLIBL(*CURRENT) CURLIB(*CURRENT)

However, many shops frown on hard coding library names into your programs. For one thing, it can often make them harder to test in other environments, which are often set up to use alternate library lists. Retrieving the library name from a data area or such might be an acceptable alternative.

B)

In many situations, submitting the job with a job description might be considered a better choice. In this case, you would want to specify:

SBMJOB ...   JOBD(______) INLLIBL(*JOBD)

Here too, you could make it test environment friendly by retrieving the name of the job description to be used, or let the job description be found on the library list, so that a testing job description can be found on the library list above (or instead of) the normal version of that job description.

Yes, that library needs to be added to the LIBL again in PGM C. Yes, the library list starts with it's default values with every new job submitted.

Related