precompile compile and link edit jcl for cobol db2 program

 

 
 
 
 
 
 
 
 
 
 
Precompile compile and link edit jcl for cobol db2 program
 
The following JCL can be used for compilng and link editing a COBOL DB2 program. This JCL has mainly three steps 
 
PRE COMPILATION:-
 
The PRE COMPILATION Step executes the utility DSNHPC and uses the COBOL DB2
program present in source library and copy library for DCLGEN's  as input and 
creates the DBRM with the name of the source program in a temporary library
and a modified source program in SYSCIN which is passed on to compilation step.
 
 
COMPILATION:-
 
The COMPILATION step executes utility IGYCRCTL and takes as input the modified source
program (COBOL module without SQL statements) and copy library and creates an 
OBJECT code as output of this step.
 
 
LINK EDIT:-
 
The Link edit step executes utility IEWBLINK and takes as input the Object module created
by compilation step and link edits it to create the final load file.
 
//**********************************************************************
//* INSTRUCTIONS FOR USING THE JOB :->
//*
//* PRECOMP IS PRECOMPILATION STEP (CHANGE REQD)
//*
//*  1. CHANGE <STEPLIB1> TO SYSTEM LIBRARY FROM WHERE TO RUN DSNHPC
//*  2. CHANGE ALL <COPYLIB> TO LIBRARY CONTAINING DCLGEN COPYBOOKS
//*  3. CHANGE <PGMSRC> TO THE LIBRARY CONTAINING SOURCE MODULE
//*  4. CHANGE <PGMNAME> TO NAME OF SOURCE MODULE
//*
//* COMPSTEP IS COMPILATION STEP (CHANGE REQD)
//*  1. CHANGE <STEPLIB2> TO SYSTEM LIBRARY FROM WHERE TO RUN DSNHPC
//*  2. CHANGE ALL <COPYLIB> TO LIBRARY CONTAINING DCLGEN COPYBOOKS
//*
//* LINKSTEP IS LINK EDIT STEP (CHANGE REQD)
//*
//*  1. CHANGE <LOADLIB> TO LIBRARY WHICH WILL STORE THE LOAD MODULE
//*  2. CHANGE <SYSLIB1> TO SYSTEM LIBRARY FOR EXEC IEWBLINK
//*  3. CHANGE <SYSLIB2> TO SYSTEM LIBRARY FOR EXEC IEWBLINK
//*  4. CHANGE <PGMNAME> TO NAME OF SOURCE MODULE
//*
//* COPYDBRM IS LINK EDIT STEP
//*
//*  1. CHANGE <DBRMLIB> TO LIBRARY WHICH WILL STORE THE DBRM
//*
//**********************************************************************
//*          P R E      C O M P I L A T I O N
//**********************************************************************
//PRECOMP  EXEC PGM=DSNHPC,
//             PARM=('HOST(COB2)','FLAG(I)','LINECOUNT(60)',
//             APOST,APOSTSQL,PERIOD,NOOPTIONS,SOURCE)
//**********************************************************************
//* STEPLIB:-LIBRARY FROM WHERE PRECOMPILE UTILITY WILL BE PICKED
//*          THIS WILL BE SYSTEM DEFINED LIBRARIES
//**********************************************************************
//STEPLIB   DD DSN=<STEPLIB1>,
//             DISP=SHR
//**********************************************************************
//* SYSLIB :-LIBRARY CONTAINING DCLGEN COPYBOOKS
//**********************************************************************
//SYSLIB    DD DSN=<COPYLIB>,
//             DISP=SHR
//SYSPRINT  DD SYSOUT=*
//SYSTERM   DD SYSOUT=*
//SYSUDUMP  DD SYSOUT=*
//SYSUT1    DD UNIT=VIO,
//             SPACE=(CYL,(5,5))
//SYSUT2    DD UNIT=VIO,
//             SPACE=(CYL,(5,5))
//**********************************************************************
//* DBRMLIB:-LIBRARY WHERE DBRM WILL BE STORED
//**********************************************************************
//DBRMLIB   DD DSN=&TEMPDBRM(<PGMNAME>),
//             DISP=(NEW,PASS),
//             UNIT=VIO,
//             SPACE=(CYL,(5,5,1)),
//             DCB=(RECFM=FB,LRECL=80,BLKSIZE=23440)
//SYSCIN    DD DSN=&SYSCIN,
//             DISP=(NEW,PASS),
//             UNIT=SYSDA,
//             SPACE=(CYL,(5,5)),
//             DCB=(RECFM=FB,LRECL=80,BLKSIZE=23440)
//**********************************************************************
//* SYSIN:-SOURCE LIBRARY CONTAINING COBDB2 MODULE
//**********************************************************************
//SYSIN     DD DSN=<PGMSRC>(<PGMNAME>),
//             DISP=SHR
//**********************************************************************
//*                C O M P I L A T I O N
//**********************************************************************
//COMPSTEP EXEC PGM=IGYCRCTL,
//             PARM=('LIB,RENT,DATA(31),OFFSET',
//             'BUF(32K),OPT,MAP',
//             'NODYNAM,NOADV,NOTERM',
//             'NUMPROC(NOPFD)',
//             'NOLIST'),
//             COND=(4,LT,PRECOMP)
//**********************************************************************
//* STEPLIB:-LIBRARY FROM WHERE COMPILE UTILITY WILL BE PICKED
//*          THIS WILL BE SYSTEM DEFINED LIBRARIES
//**********************************************************************
//STEPLIB   DD DSN=<STEPLIB2>,
//             DISP=SHR
//SYSLIN    DD DSN=&OBJECT,
//             DISP=(NEW,PASS,DELETE),
//             UNIT=SYSDA,
//             SPACE=(CYL,(10,5)),
//             DCB=(RECFM=FB,BLKSIZE=3200)
//SYSUT1    DD UNIT=VIO,
//             SPACE=(CYL,(5,5))
//SYSUT2    DD UNIT=VIO,
//             SPACE=(CYL,(5,5))
//SYSUT3    DD UNIT=VIO,
//             SPACE=(CYL,(5,5))
//SYSUT4    DD UNIT=VIO,
//             SPACE=(CYL,(5,5))
//SYSUT5    DD UNIT=VIO,
//             SPACE=(CYL,(5,5))
//SYSUT6    DD UNIT=VIO,
//             SPACE=(CYL,(5,5))
//SYSUT7    DD UNIT=VIO,
//             SPACE=(CYL,(5,5))
//SYSPRINT  DD SYSOUT=*
//**********************************************************************
//* SYSLIB :-LIBRARY CONTAINING DCLGEN COPYBOOKS
//**********************************************************************
//SYSLIB    DD DSN=<COPYLIB>,
//             DISP=SHR
//SYSIN     DD DSN=&SYSCIN,
//             DISP=(OLD,DELETE,DELETE)
//**********************************************************************
//*         L I N K   E D I T
//**********************************************************************
//LINKSTEP EXEC PGM=IEWBLINK,
//             PARM='SIZE=(1920K,256K),LIST,XREF,NCAL',
//             COND=((4,LT,PRECOMP),(4,LT,COMPSTEP))
//SYSUT1    DD UNIT=VIO,
//             SPACE=(CYL,(15,10))
//SYSPRINT  DD SYSOUT=*
//**********************************************************************
//* SYSLMOD:-LIBRARY WHICH WILL STORE THE LOAD MODULE
//**********************************************************************
//SYSLMOD   DD DSN=<LOADLIB>,
//             DISP=SHR
//**********************************************************************
//* SYSLIB :-SYSTEM LIBRARIES FOR EXECUTING IEWBLINK
//**********************************************************************
//SYSLIB    DD DSN=<SYSLIB1>,
//             DISP=SHR
//          DD DSN=<SYSLIB2>,
//             DISP=SHR
//**********************************************************************
//* INSTREAM DATA:- <PGMNAME> NAME OF THE COBOL MODULE
//**********************************************************************
//SYSLIN    DD DSN=&OBJECT,
//             DISP=(OLD,DELETE,DELETE)
//          DD *
 NAME <PGMNAME>(R)
/*
//**********************************************************************
//*     C O P Y  D B R M  S T E P                                      *
//**********************************************************************
//COPYDBRM EXEC PGM=IEBCOPY,
//             COND=((4,LT,PRECOMP),(4,LT,COMPSTEP),(4,LT,LINKSTEP))
//**********************************************************************
//* PERMDBRM:- LIBRARY WHERE THE DBRM WILL BE STORED
//**********************************************************************
//PERMDBRM  DD DSN=<DBRMLIB>,
//             DISP=SHR
//**********************************************************************
//* TEMPDBRM:- LIBRARY WHERE THE DBRM WAS CREATED TEMPORARILY
//**********************************************************************
//TEMPDBRM  DD DSN=&TEMPDBRM,
//             DISP=(OLD,DELETE,DELETE)
//SYSPRINT  DD SYSOUT=*
//SYSUT3    DD UNIT=VIO,
//             SPACE=(CYL,(5,2))
//SYSUT4    DD UNIT=VIO,
//             SPACE=(CYL,(5,2))
//SYSIN     DD *
 COPY OUTDD=PERMDBRM
      INDD=((TEMPDBRM,R))
/*