Compile JCL for COBOL Program


There are two ways to compile the COBOL program and those are –

  • Create a JCL using Version control tools - Version control tools like Endeavor or Change man are used to compile the COBOL program in a real-time environment.
  • Standard alone JCL/project Specific JCL - We can also create a standard JCL to compile the program apart from version control tools. You can get a compilation JCL from your colleague/team lead in the project by specifying that you are unaware of compilation utility libraries.

The compilation JCL has two steps –

  • Compiling the COBOL program.
  • LINK EDIT the COBOL program.

Compiling the COBOL program step -


Scenario - The following example shows the general format of JCL used to compile a program.

//jobname  JOB  acctno,name,MSGCLASS=1                   (1)
//stepname EXEC PGM=IGYCRCTL,PARM=(options)              (2)
//STEPLIB  DD   DSNAME=IGY.V6R3M0.SIGYCOMP,DISP=SHR      (3)
//         DD   DSNAME=SYS1.SCEERUN,DISP=SHR
//         DD   DSNAME=SYS1.SCEERUN2,DISP=SHR
//SYSUT1   DD   UNIT=SYSALLDA,SPACE=(subparms)           (4)
//SYSUT2   DD   UNIT=SYSALLDA,SPACE=(subparms)
//SYSUT3   DD   UNIT=SYSALLDA,SPACE=(subparms)
//SYSUT4   DD   UNIT=SYSALLDA,SPACE=(subparms)
//SYSUT5   DD   UNIT=SYSALLDA,SPACE=(subparms)
//SYSUT6   DD   UNIT=SYSALLDA,SPACE=(subparms)
//SYSUT7   DD   UNIT=SYSALLDA,SPACE=(subparms)
//SYSUT8   DD  UNIT=SYSALLDA,SPACE)=(subparms)
//SYSUT9   DD  UNIT=SYSALLDA,SPACE=(subparms)
//SYSUT10  DD  UNIT=SYSALLDA,SPACE=(subparms)
//SYSUT11  DD  UNIT=SYSALLDA,SPACE=(subparms)
//SYSUT12  DD  UNIT=SYSALLDA,SPACE=(subparms)
//SYSUT13  DD  UNIT=SYSALLDA,SPACE=(subparms)
//SYSUT14  DD  UNIT=SYSALLDA,SPACE=(subparms)
//SYSUT15  DD  UNIT=SYSALLDA,SPACE=(subparms)
//SYSMDECK DD  UNIT=SYSALLDA,SPACE=(subparms)
//SYSPRINT DD   SYSOUT=A                                (5)
//SYSLIN   DD   DSNAME=&&LOADSET,DISP=(OLD,DELETE)      (6)
//              DISP=(MOD,PASS),SPACE=(subparms)
//SYSIN    DD   DSNAME=dsname,UNIT=device,              (7)
                VOLUME=(subparms),DISP=SHR

Explaining JCL -

  1. The JOB statement specifies the job beginning.
  2. The EXEC statement specifies the Enterprise COBOL compiler (IGYCRCTL) is to be invoked.
  3. The DD statement specifies the data set where the COBOL compiler resides.
  4. The SYSUT DD statements specify the utility data sets that the compiler will use to process the source program. All SYSUT files should be on direct-access storage devices.
  5. The SYSPRINT DD statement specifies the data set that receives output from compiler options.
  6. The SYSLIN DD statement specifies the output data set that receives from the compiler step and pass it to the likedit step.
  7. The SYSIN DD statement specifies the source data set where the COBOL program code written.

LINK EDIT the COBOL program step –


Scenario - The following example shows the general format of JCL used to compile a program.

//LKED   EXEC PGM=IEWBLINK,COND=(8,LT,COBOL),REGION=0M    (1) 
//SYSLIB   DD  DSNAME=CEE.SCEELKED,DISP=SHR               (2) 
//SYSPRINT DD  SYSOUT=*                                   (3) 
//SYSLIN   DD  DSNAME=&&LOADSET,DISP=(OLD,DELETE)         (4)
//         DD  DDNAME=SYSIN                          
//SYSLMOD  DD  DSNAME=MATEGJ.LOADLIB(FIRSTPRG),DISP=OLD   (5) 
//SYSUT1   DD  UNIT=SYSALLDA,SPACE=(TRK,(10,10))          (6)
//SYSIN    DD  DUMMY 					      

Explaining JCL -

  1. The EXEC statement specifies Link Editor (IEWBLINK) is to be invoked.
  2. The SYSLIB DD statement specifies the data set where the IEWBLINK resides.
  3. The SYSPRINT DD statement defines the data set that receives output.
  4. The SYSLIN DD statement specifies the data set where the object code stored by COMPILE step.
  5. SYSLMOD DD statement specifies the data set, where the executable load module to be stored.
  6. The SYSUT DD statements specify the utility data sets that the IEWBLINK will use to complete the process.

Compilation JCL –


COBOL program compilation JCL
----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
//MATEGJC JOB (123),'MTH',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),            
//             NOTIFY=&SYSUID                                           
//********************************************************************
//*  COMPILE A COBOL PROGRAM                            
//********************************************************************
//COBOL  EXEC PGM=IGYCRCTL,REGION=0M,PARM=('LIB')                     
//STEPLIB  DD  DSNAME=IGY420.SIGYCOMP,                                
//             DISP=SHR                                               
//SYSIN    DD  DSN=MATEGJ.COBOL.SRCLIB(FIRSTPRG),DISP=SHR             
//SYSLIB   DD  DSN=MATEGJ.COPYLIB,DISP=SHR               
//SYSPRINT DD  SYSOUT=*                                               
//SYSLIN   DD  DSNAME=&&LOADSET,UNIT=SYSALLDA,                        
//             DISP=(MOD,PASS),SPACE=(TRK,(3,3)),                     
//             DCB=(BLKSIZE=3200)                                     
//SYSUT1   DD  UNIT=SYSALLDA,SPACE=(CYL,(1,1))                        
//SYSUT2   DD  UNIT=SYSALLDA,SPACE=(CYL,(1,1))                        
//SYSUT3   DD  UNIT=SYSALLDA,SPACE=(CYL,(1,1))                        
//SYSUT4   DD  UNIT=SYSALLDA,SPACE=(CYL,(1,1))                        
//SYSUT5   DD  UNIT=SYSALLDA,SPACE=(CYL,(1,1))                        
//SYSUT6   DD  UNIT=SYSALLDA,SPACE=(CYL,(1,1))                        
//SYSUT7   DD  UNIT=SYSALLDA,SPACE=(CYL,(1,1))                        
//********************************************************************
//*  LINK EDIT A COBOL PROGRAM                            
//********************************************************************
//LKED   EXEC PGM=IEWBLINK,COND=(8,LT,COBOL),REGION=0M                
//SYSLIB   DD  DSNAME=CEE.SCEELKED,DISP=SHR                           
//SYSPRINT DD  SYSOUT=*                                               
//SYSLIN   DD  DSNAME=&&LOADSET,DISP=(OLD,DELETE)                     
//         DD  DDNAME=SYSIN                                           
//SYSLMOD  DD  DSNAME=MATEGJ.LOADLIB(FIRSTPRG),DISP=OLD  
//SYSUT1   DD  UNIT=SYSALLDA,SPACE=(TRK,(10,10))                      
//SYSIN    DD  DUMMY                                                  
********************** BOTTOM OF DATA ********************************