JOBLIB and STEPLIB

JOBLIB and STEPLIB in JCL both are used to specify the load libraries so that that the programs that are being used in that JCL/JOB are searched in these libraries. Generally z/OS searches for the programs load module in the default system libraries where actually the IBM supplied programs are stored. Specifying JOBLIB/steplib makes the Z/OS to search in these libraries first and then in system libraries.Both JOBLIB & STEPLIB are used for the same purpose except that JOBLIB is applicable for all the steps of a JOB where as the STEPLIB is limited to that step only.

What happens if both JOBLIB and STEPLIB are specified in a job? Which one has first preference. In this case, if steplib is specified for a STEP, Z/OS first looks for the program load MODULE in the steplib library. If it does not find it in there, then it searches in the SYSTEM LOAD LIBRARIES. So STEPLIB overrides the JOBLIB. Note that in this case, it does not go back to JOBLIB to search.

Multiple libraries can be specified under one DD statement, in this case z/OS searches for the load modules in the libraries one after another in the order they are given.

What is a LOAD Module: Load module is nothing but the executable code of a program which gets created in the compilation process (Link Edit part) and stored in a PDS specified in the compile JCL. These Load libraries are used in JOBs to execute the programs. To give more insight, we need to know about Source and Object Modules as well.

  • Source Module is the code that we write in a PDS, this is not an executable one.
  • Source code when under goes compilation process, Object module gets created.
  • Object module when under goes Link Edit process, Load module gets created. This includes all the references that are present in the source code like date routines, Sub programs etc.

Example-1:
In the below code single loca library is specified at JOB level, so it is applicable for both the steps.

Example-2:
If there are multiple Load libraries availabe and all of them needs to be specified it can be specified as below

Example-3:

Specifying both JOB lib and STEPLIBs

Leave a Reply

Your email address will not be published. Required fields are marked *