Sample RUN JCL for COBOL Program

Sample RUN JCL for a COBOL Program – In Mainframes area any batch COBOL program needs to have its corresponding JCL to run it without which it can not be executed. As we know JCL is a JOb Control Language which is used to run and control the execution of the programs. So JOB written in JCL is must to execute any batch COBOL program, The job used to run it is called a RUN JCL. Below example shows a sample Run JCL for a  program named ‘CUSTR001’.  CUSTR001  is developed to have one input file and it generates one output file using the input file records. As it uses two files, these files should also be be specified in the RUn JCL.

----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
//CUSTJB01 JOB (990A5,'25/06/19',ACNTCR),'MAHENDER',MSGCLASS=D, 
// CLASS=A,TIME=10,NOTIFY=&SYSUID 
//***************************************************************** 
//* JOB TO RUN THE PGM CUSTR001 
//*************************************************************** 
//STEP01 EXEC PGM=CUSTR001 
//STEPLIB DD DSN=CUST.PR.LOADLIB,DISP=SHR 
//CUSTIN  DD DSN=CUST.FL.EXT.IN01,DISP=SHR 
//CUSTOUT DD DSN=CUST.FL.EXT.RPT01,UNIT=SYSDA, 
//           DISP=(NEW,CATLG,DELETE),SPACE=(CYL,(1,1),RLSE), 
//           DCB=(RECFM=FB,LRECL=40,BLKSIZE=0) 
//SYSPRINT DD SYSOUT=* 
//SYSOUT DD SYSOUT=A 
//

First two line of the JOB are called JOB card and more information on the job card can be found at JCL JOB Card

Notes:

  • CUSTJB01 –> This is the JOB name, It can be be any name but should be limited to 8 char length.
  • JOB             –> It is a Keyword parameter and is must to specify.
  • STEP01       –> This is the STEP Name which can be any name like CUST01, RPT01 etc. The point here is, no need to include the word STEP in the  stepname. There can be many steps in a JOB and each step can execute a Program.
  • EXEC PGM –> This is the place where the program that needs to executed should be given.
  • STEPLIB     –> Here load Libraries should be specified, It can be one or more than one. If more than one load libraries are specified, then the OS searches all the specified load libraries in the order they are given  and Once it finds in one of them it stops searching for it further.
  • CUSTIN      –> This is the input file. Relationship between COBOL file and this JCL file is established in the COBOL FILE CONTROL area.
  • CUSTOUT  –> Output file name. As it is a New file, it should be specified with DISP, SPACE and DCB details.
  • SYSPRINT and SYSOUT are used to display the messages that gets generated while running.
4 Comments

Add a Comment

Your email address will not be published. Required fields are marked *