Batch Execution Order STEPLIB, JOBLIB, LINKLIB, SYSLIB
search cancel

Batch Execution Order STEPLIB, JOBLIB, LINKLIB, SYSLIB

book

Article ID: 187082

calendar_today

Updated On:

Products

Gen Gen - Workstation Toolset Gen - Host Encyclopedia Gen - Run Time Distributed

Issue/Introduction

This is an internal doc with an explanation on execution order for z/OS batch programs.

Environment

Release : 8.6

Component : CA Gen Host Encyclopedia

Resolution

Libraries can define in a DD statement in the following ways:

  • With the ddname STEPLIB at any point in the job step. The STEPLIB is searched before any system library or JOBLIB specified in a JOBLIB DD statement for the job step in which it appears (although an executable program can also be passed to subsequent job steps in the usual way). When a STEPLIB and JOBLIB are both present, the STEPLIB is searched for the step in which it appears and, for that step, the JOBLIB is ignored.

    The system searches for executable programs in the following order of precedence:

    1. Library specified in STEPLIB statement
    2. Library specified in JOBLIB statement
    3. LPA or ELPA
    4. The system library SYS1.LINKLIB and libraries concatenated to it through the active LNKLSTxx member of SYS1.PARMLIB
    In the following example, the system searches USER.LOADLIB for the routine PROGRAM1 and USER.LOADLIB2 for the routine PROGRAMA:
    //JOB8    JOB  DAVE,MSGLEVEL=(2,0)
    //STEP1   EXEC PGM=PROGRAM1
    //STEPLIB DD   DSNAME=USER.LOADLIB,DISP=SHR
    //*
    //STEP2   EXEC PGM=PROGRAMA
    //STEPLIB DD   DSNAME=USER.LOADLIB2,DISP=SHR
  • With the ddname JOBLIB immediately after the JOB statement in your JCL. This library is searched before the system libraries. If any executable program is not found in the JOBLIB, the system looks for it in the system libraries.

    In the following example, the system searches the private library USER.LOADLIB for the member PROGRAM1, reads the member into storage, and executes it.

    //JOB8    JOB  DAVE,MSGLEVEL=(2,0)
    //JOBLIB  DD   DSNAME=USER.LOADLIB,DISP=SHR
    //STEP1   EXEC PGM=PROGRAM1

Additional Information

This info can be found at this link:

https://www.ibm.com/support/knowledgecenter/SSLTBW_2.2.0/com.ibm.zos.v2r2.ceea200/ldasord.htm