Sunday, 28 July 2013

JOBLIB, STEPLIB and PROCLIB Is Not Rocket Science! Learn Them Now!

Welcome back to my blog once again Guys!

In today's tutorial, I would be discussion two important terminology JOBLIB and STEPLIB in Job Control Language (JCL). This tutorial will cover few examples for better understanding. So, lets start with the tutorial on Step-lib and Job-lib.

STEP LIB
JOB LIB and STEP LIB

A system library names SYS1.LINKLIB contains all the IBM-supplied system programs, such as compilers, linkage editor, and service programs. JOBLIB statements are placed immediately after the JOB card (JOB STATEMENT) and it is effective for all the job steps.

You can not place JOBLIB in catalog procedure. If the system does not find program in named library, it searches from different libraries. The system searches the libraries in the order on which you name them in the DD statements. 

Example: JOBLIB in JCL. 

//RT2345EX JOB (1234), ‘RC MAINFRAME’,CLASS=A 
//JOBLIB    DD DSN=RCTX0.COMPLIB.LOAD,DISP=SHR
//          DD DSN=A1000.PRINTLIB.LOAD,DISP=SHR


Example: STEPLIB in JCL.

The //STEPLIB DD statement, similar in the form and function to the job lib statement, is placed after EXEC statement and is effective only for that job step. STEPLIB provides an alternative means of specifying a private library


//RT2345EX  JOB (23456),‘RUCHIN’, CLASS=A
//STEP1     EXEC PGM=EMP23456
//STEPLIB   DD DSN=RCTX00.COMPLIB.LOAD, DISP=SHR
//*
//STEP2     EXEC PGM=EMPNTX
//STEPLIB   DD DSN=RCTX00.PRINTLIB.LOAD, DISP=SHR

Important points regarding JOBLIB and STEPLIB. 

  • IF both JOBLIB and STEPLIB is included in job, then STEPLIB DD statement overrides the JOBLIB DD statements.
  • If several steps execute program from the same library, use a JOBLIB DD statement. But if the steps execute from different libraries, use STEPLIB DD statements. There is nothing advantage to STEPLIB DD statement.

STEPLIB and JOBLIB coding recommendation.


  • You will often use a text editor to piece together steps from different jobs to create a new job. When you use //STEPLIB DD statement each step stands by itself.
  • But if you use //JOBLIB DD statement, you must remember to also copy the //JOBLIB DD statement, which may be located far away from the EXEC statement and is easy to overlook.

The search sequence for private libraries


JOBLIB STEPLIB
The search sequence for private libraries


Program in Temp Libraries.

Often the outputs from one job step become the program to execute in subsequent step. You usually execute the linkage editor load module in a following step.

If you need the load module output from the linkage editor only for the duration of job, place it in temp library.

Then rather than naming the program to execute, it is easier to refer back to the DD statement describing the data set containing the program. The step executing the program need not follow step creating the program.

Example: REFERBACK in JCL / BACKWARD REFERENCE in JCL

//LINK  EXEC PGM=IEWL
//SYSLMOD DD DSN=TEMP(GO),DISP=(NEW,PASS,DELETE),
//           UNIT=SYSDA,SPACE=(1024,(10,20,1))
//STEP2 EXEC PGM=IEA001
//STEP3 EXEC PGM=*.LINK.SYSLMOD


The backward reference (refer back) names the step and then the DD statement within then step, If you invoke catalog procedure, the REFERBACK must include the catalog procedure STEPLIB.

No comments:

Post a comment