Sample JCL for compiling VS COBOL II programs

Here is an example of JCL for compiling a VS COBOL II program for use with the ADFz family of products. This sample is a generic sample, and might not meet all your requirements.

Notice the compiler options that are used and notice that the compiler listing is passed to an added step that generates a LANGX file. The compiler listing can be stored in a permanent file or can be passed in a temporary file. For VS COBOL II, these are the only required changes.

However, there is an optional change in the linkage editor step. The example includes a special Language Environment® exit module in the application load module. Although this exit module is not required, it enables the use of z/OS® Debugger panel 6, which makes the debugger easier to start in some environments. If you prefer to use panel 6 to start z/OS® Debugger, this inclusion is one way to enable it. If you do not plan to use z/OS® Debugger panel 6, then do not include an exit module. Do not include the exit module for CICS® programs or if the module is not linked with Language Environment® services (it is linked with COBOL II runtime services).

//*     - - -  ADD A JOB CARD ABOVE THIS LINE  - - -
//*
//*  SAMPLE JCL TO PREPARE A VS COBOL II PROGRAM
//*  FOR THE IBM ZSERIES ADFz PRODUCTS:
//*     FAULT ANALYZER, DEBUG TOOL, AND APPLICATION PERF. ANALYZER
//*
//*  NOTES:
//*
//*   COMPILER:
//*    1. COMPILER OPTIONS LIST,MAP,SOURCE,XREF ARE REQUIRED IF YOU
//*       PLAN TO USE THE LISTING WITH AN ADFz PRODUCT, OR TO
//*       PROCESS THE LISTING WITH THE IPVLANGX UTILITY
//*    2. COMPILER OPTION NOTEST IS SUGGESTED FOR ALL COBOL II
//*       PROGRAMS, EVEN IF IBM DEBUG TOOL FOR Z/OS WILL BE USED
//*
//*   BINDER (LINKAGE EDITOR):
//*    3. IN THIS EXAMPLE, THE MODULE IS LINKED WITH LANGUAGE
//*       ENVIRONMENT RUNTIME SERVICES. THIS IS CONTROLLED BY THE
//*       LIBRARY OR LIBRARIES SPECIFIED IN THE SYSLIB DD IN THE
//*       BINDER STEP.
//*    4. THE INCLUDE FOR MODULE EQAD?CXT IS *OPTIONAL*.  IT IS AN
//*       LE EXIT MODULE THAT CAN BE USED TO START DEBUG TOOL.
//*       UNDERSTAND THE METHODS AVAILABLE FOR STARTING DEBUG TOOL,
//*       AND CHOOSE WHETHER YOU WANT TO USE THE LE EXITS.
//*         IF YOU USE THIS METHOD, LOAD THE CORRECT EXIT MODULE:
//*            EQADBCXT: FOR BATCH PROGRAMS
//*            EQADICXT: FOR ONLINE IMS PROGRAMS
//*            EQADDCXT: FOR DB2 STORED PROCEDURES (OF TYPE MAIN AND SUB)
//*           (for SUB this is supported only for invocations through call_sub)
//*         (DO NOT INCLUDE AN EXIT FOR CICS PROGRAMS, OR FOR
//*          PROGRAMS LINKED WITH THE COBOL II RUNTIME SERVICES
//*          INSTEAD OF LANGUAGE ENVIRONMENT RUNTIME SERVICES)
//*          YOU CAN ALSO USE MODULE EQAD3CXT FOR BATCH PROGRAMS, ONLINE IMS
//*          PROGRAMS, DB2 TYPE MAIN STORED PROCEDURES.
//*
//*  SET OPTIONS FOR THIS COMPILE:
//*  ---------------------------
//   SET MEM=SAMII1                          PROGRAM NAME
//   SET COB2COMP='IGY.V1R4M0.COB2COMP'      COBOL II COMPILER LIB
//   SET DTLIB='EQAW.SEQAMOD'                DEBUG TOOL LOADLIB
//   SET LELKED='CEE.SCEELKED'               LE LINK LIBRARY
//   SET LELIB='CEE.SCEERUN'                 LE RUNTIME LIBRARY
//   SET UNITDEV=SYSALLDA                    TEMP data set UNIT
//   SET LANGX='IPVLANGX'                    IPVLANGX UTILITY PROGRAM
//   SET LANGXLIB='IPV.SIPVMODA'             LIB FOR IPVLANGX UTILITY
//*    NOTE: USE THE IPVLANGX FACILITY SHIPPED WITH THE COMMON COMPONENT.
//*
//*  ****************************
//*        COMPILE STEP
//*  ****************************
//COMPILE  EXEC PGM=IGYCRCTL,REGION=4M,
//   PARM=('NOTEST,LIST,MAP,NOOPT,SOURCE,XREF,NONUMBER',
//         'RES,APOST,LIB,DYNAM,NORENT,NOSSRANGE')
//STEPLIB  DD DISP=SHR,DSN=&COB2COMP
//SYSIN    DD DISP=SHR,DSN=&SYSUID..ADLAB.SOURCE(&MEM)
//SYSLIB   DD DISP=SHR,DSN=&SYSUID..ADLAB.COPYLIB
//SYSPRINT DD DISP=SHR,DSN=&SYSUID..ADLAB.LISTING(&MEM)
//SYSLIN   DD DISP=(MOD,PASS),DSN=&&LOADSET,UNIT=&UNITDEV,
//            SPACE=(80,(10,10))
//SYSUT1   DD SPACE=(80,(10,10),,,ROUND),UNIT=&UNITDEV
//SYSUT2   DD SPACE=(80,(10,10),,,ROUND),UNIT=&UNITDEV
//SYSUT3   DD SPACE=(80,(10,10),,,ROUND),UNIT=&UNITDEV
//SYSUT4   DD SPACE=(80,(10,10),,,ROUND),UNIT=&UNITDEV
//SYSUT5   DD SPACE=(80,(10,10),,,ROUND),UNIT=&UNITDEV
//SYSUT6   DD SPACE=(80,(10,10),,,ROUND),UNIT=&UNITDEV
//SYSUT7   DD SPACE=(80,(10,10),,,ROUND),UNIT=&UNITDEV
//*
//CBLPRINT  EXEC PGM=IEBGENER,REGION=0M
//SYSPRINT  DD SYSOUT=*
//SYSUT1    DD DSN=&SYSUID..ADLAB.LISTING(&MEM),DISP=SHR
//SYSUT2    DD SYSOUT=*
//SYSIN     DD DUMMY
//*
//* *********************************
//* STEP TO GENERATE A LANGX FILE
//* *********************************
//LANGX EXEC PGM=&LANGX,REGION=32M,
//   PARM='(COBOL ERROR 64K CREF'
//STEPLIB  DD DISP=SHR,DSN=&LANGXLIB
//         DD DISP=SHR,DSN=&LELIB
//LISTING  DD DSN=&SYSUID..ADLAB.LISTING(&MEM),DISP=SHR
//IDILANGX DD DISP=SHR,DSN=&SYSUID..ADLAB.EQALANGX(&MEM)
//*
//*  *********************************
//*        LINK-EDIT (BINDER) STEP
//*  *********************************
//LKED EXEC PGM=IEWL,REGION=0M,COND=(5,LT,COMPILE),PARM='LIST,XREF'
//SYSLIB   DD DISP=SHR,DSN=&LELKED
//DTLIB    DD DISP=SHR,DSN=&DTLIB
//SYSLMOD  DD DSN=&SYSUID..ADLAB.LOAD(&MEM),DISP=SHR
//SYSLIN   DD DISP=(OLD,DELETE),DSN=&&LOADSET
//*  INCLUDING A DEBUG TOOL LE EXIT (EQADBCXT, EQADDCXT, EQADICXT OR EQAD3CXT)
//* IS OPTIONAL
//*  AN EXIT ENABLES STARTING DEBUG TOOL USING THE USER EXIT DATA SET UTILITY
//*  (ONE OF THE DEBUG TOOL ISPF UTILITIES)
//*  //        DD *
//*   INCLUDE DTLIB(EQADBCXT)
//SYSPRINT DD SYSOUT=*
//SYSUT1   DD UNIT=&UNITDEV,DCB=BLKSIZE=1024,SPACE=(1024,(200,20))