Monday, April 9, 2012

How MVS finds the program or procedure


To run a program or procedure, first MVS has to search and find that program or procedure. We have to use JOBLIB, STEPLIB, or JCLLIB statements to reduce search time.


Where MVS searches depends on what we specify in the JCL:
  • For programs, MVS will automatically search standard system program libraries, such as SYS1.LINKLIB, which contains IBM-supplied programs. If the program we want to run resides in a private program library, we must specify either a JOBLIB DD statement or a STEPLIB DD statement for MVS to successfully locate the program.
    • When we submit the job, MVS will search any private libraries specified on the JOBLIB DD statement before searching system libraries. MVS 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 we use a STEPLIB DD statement, we may place it anywhere within a job step but it typically appears after the EXEC statement. When we submit the job, MVS 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.
  • For procedures, MVS will automatically search standard system procedure libraries, such as SYS1.PROCLIB. If the procedure we want to run resides in a private library, we must specify the JCLLIB statement for MVS 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, we 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.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.