To successfully run the program or procedure that you specify on
a JCL EXEC statement, z/OS® has to search for and find that program or procedure.
Using JOBLIB, STEPLIB, or JCLLIB statements can reduce search time.
Where z/OS searches
depends on what you specify in your JCL:
- When you code the PGM parameter, z/OS looks for an application program,
and will automatically search standard system program libraries, such as SYS1.LINKLIB,
which contains IBM-supplied programs. If the program you want to run resides
in a private program library, you must specify either a JOBLIB DD statement
or a STEPLIB DD statement for z/OS to successfully locate the program.
- When you use a JOBLIB DD statement, insert the JOBLIB DD statement in
the job before the first EXEC statement in the job. When you submit the job, z/OS will
search any private libraries specified on that JOBLIB DD statement before
searching system libraries. z/OS repeats that search order for any programs called
within the job.
For a multi-step job, using the JOBLIB DD statement is
most efficient when most of the programs reside in private libraries.
- When you use a STEPLIB DD statement, you may place it anywhere within
a job step but it typically appears after the EXEC statement. When you submit
the job, z/OS will
search the private libraries specified on that STEPLIB DD statement, but only
for the one step.
For a multi-step job, using the STEPLIB DD statement is
most efficient when most of the programs reside in system, rather than private,
libraries.
- When you code the PROC parameter or you omit the PGM or PROC parameter, z/OS looks
for a procedure and will automatically search standard system procedure libraries,
such as SYS1.PROCLIB. If the procedure you want to run resides in a private
library, you must specify the JCLLIB statement for z/OS to successfully locate the procedure.
If
a job does not specify a procedure library, the system retrieves all cataloged
procedures called by EXEC statements from the procedure libraries defined
by the installation for the job's job class. To direct the system to search
another procedure library, or to limit the procedure libraries it searches,
code a JCLLIB statement that identifies one or more libraries. On a JCLLIB
statement, you may list system libraries, installation-defined libraries,
or private libraries. The system searches the libraries in the order in which
they are specified on JCLLIB.