Sunday 28 July 2013

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


STEP LIB, JCL Tutorial, JCL JOBLIB

JOB LIB and STEP LIB


Hey! Mainframer's welcome back to today's session on JOBLIB and STEPLIB. In this, JCL tutorial you'll the basics of JOBLIB and STEPLIB statements and what is the significance of these statements in JCL. You'll learn the difference between steplib and joblib in JCL. Let's get started with an introduction to JCL. 


JCL Tutorial - Agenda. 


  • JCL Overview. 
  • JOBLIB in JCL. 
  • STEPLIB in JCL. 

JCL Overview. 

Job Control Language is the command language of the Z/OS Operating System.  JCL describes a job by providing information that identifies the programs to be executed and the data to be processed. JCL tells the operating system what to do.

IBM Mainframe supports the z/OS operating system and like any other operating system, z/OS has system libraries (i.e. SYS1.LINKLIB). However, you can define a private library to store program load modules. These libraries are used by the system to pick load modules during the JCL execution. JCLLIB and STEPLIB statements are used to specify these libraries in the JCL's. 

JOBLIB in JCL. 

JOBLIB statement is specified immediately after the JOB statement (i.e. JOB CARD). JOBLIB is applicable for all steps in JCL. You cannot use JOBLIB in a cataloged procedure. 

JOBLIB Syntax. 

   //[name]  JCLLIB  [keyword-parameter]...


#1. JOBLIB in JCL Example. 

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


STEPLIB in JCL. 

The STEPLIB statement in JCL's is specified immediately after the EXEC statement. JCL STEPLIB statement is effective for that job step and you can use STEPLIB in JCL cataloged procedures. Important point - If you specify JOBLIB and STEPLIB in the mainframe job (JCL), then precedence would be given to STEPLIB.


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: 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),‘MAINFRAME’, 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.

Conclusion.

Subscribe to Topictrick & Don't forget to press THE BELL ICON to never miss any updates. Also, Please visit mention the link below to stay connected with Topictrick and the Mainframe forum on - 

► Youtube
► Facebook 
► Reddit

Thank you for your support. 
Mainframe Forum™

No comments:

Post a Comment

New In-feed ads