Sample JCL for compiling z/OS® C programs with TEST
Here is a JCL example for compiling a z/OS® C program for use with the ADFz family of products.
//* ADD A JOB CARD HERE
//*
//*
//* SAMPLE JCL TO PREPARE A Z/OS C PROGRAM USING TEST WITH HOOKS
//* FOR THE IBM ZSERIES ADFz PRODUCTS:
//* FAULT ANALYZER, DEBUG TOOL, AND APPLICATION PERF. ANALYZER
//*
//* NOTES:
//*
//* COMPILER:
//* 1. A 2-STAGE COMPILE IS PERFORMED. STAGE 1 (PREPROCESS) IS
//* DONE TO EXPAND INCLUDES AND MACROS IN THE PROGRAM AND TO
//* PRODUCE AN EXPANDED SOURCE FILE.
//* 2. THE EXPANDED SOURCE FILE IS RETAINED. IT IS USED BY
//* DEBUG TOOL.
//* 2. COMPILER PARMS TEST AND NOOPT ARE REQUIRED FOR DEBUG TOOL.
//* 3. COMPILER PARMS AGGREGATE, NOIPA, LIST, NOOFFSET, SOURCE,
//* AND XREF(FULL) ARE NEEDED TO FORMAT THE COMPILER LISTING
//* SO THAT IT CAN BE PROCESSED WITH IPVLANGX
//*
//* A STEP RUNS TO PRODUCE A LANGX FILE FOR FAULT ANALYZER AND APA.
//* NOTE: USE THE IPVLANGX FACILITY SHIPPED WITH THE COMMON COMPONENT.
//*
//* BINDER (LINKAGE EDITOR):
//* 1. AN 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, INCLUDE 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)
//* YOU CAN ALSO USE MODULE EQAD3CXT FOR BATCH PROGRAMS, ONLINE IMS
//* PROGRAMS, DB2 TYPE MAIN STORED PROCEDURES.
//*
//* SET PARMS FOR THIS COMPILE:
//* ---------------------------
//* CPRFX: THE PREFIX THE C COMPILE IS INSTALLED UNDER
//* LEPRFX: THE PREFIX FOR THE LE RUNTIME AND LINK LIBS
//* DTPRFX: THE PREFIX OF THE DEBUG TOOL SEQAMOD LIBRARY
//* LANGXLIB: THE PROGRAM OBJECT LIBRARY FOR THE COMMON COMPONENT
//*
// SET CPRFX=CBC
// SET LEPRFX=CEE
// SET DTPRFX=EQAW
// SET LANGXLIB=IPV.SIPVMODA
//*
//*******************************************************************/
//* CREATE C COMPILER LISTING SYSPRINT, EXPANDED SOURCE DEBUG, */
//* AND EQALANGX FILES */
//*******************************************************************/
//ALLOC EXEC PGM=IEFBR14
//LISTING DD DSN=&SYSUID..ADLAB.CLST,
// DISP=(MOD,CATLG),
// DCB=(DSORG=PO,RECFM=VBA,LRECL=137,BLKSIZE=0),
// SPACE=(TRK,(20,20,50)),UNIT=SYSDA
//DBGSRC DD DSN=&SYSUID..ADLAB.CDBG,
// DISP=(MOD,CATLG),
// DCB=(DSORG=PO,RECFM=FB,LRECL=80,BLKSIZE=0),
// SPACE=(TRK,(20,20,50)),UNIT=SYSDA
//LANGX DD DSN=&SYSUID..ADLAB.EQALANGX,
// DISP=(MOD,CATLG),
// DCB=(DSORG=PO,RECFM=VB,LRECL=1562,BLKSIZE=0),
// SPACE=(TRK,(40,40,50)),UNIT=SYSDA
//* *
//****************************************************************
//*-------------------------------------------------------------------
//* COMPILE STEP1: GENERATE EXPANDED C SOURCE FILE IN THE DD
//* SYSUT10
//*-------------------------------------------------------------------
//COMP1 EXEC PGM=CCNDRVR,REGION=0M,
// PARM=('PP(COMMENTS,NOLINES)')
//STEPLIB DD DSNAME=&LEPRFX..SCEERUN2,DISP=SHR
// DD DSNAME=&CPRFX..SCCNCMP,DISP=SHR
//SYSMSGS DD DUMMY,DSN=&CPRFX..SCBC3MSG(EDCMSGE),DISP=SHR
//SYSLIB DD DSNAME=&LEPRFX..SCEEH.H,DISP=SHR
// DD DSNAME=&LEPRFX..SCEEH.SYS.H,DISP=SHR
// DD DSNAME=&SYSUID..ADLAB.COPYLIB,DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSCPRT DD SYSOUT=*
//SYSUT1 DD UNIT=SYSDA,SPACE=(32000,(30,30)),
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=3200)
//SYSUT5 DD UNIT=SYSDA,SPACE=(32000,(30,30)),
// DCB=(RECFM=FB,LRECL=3200,BLKSIZE=12800)
//SYSUT6 DD UNIT=SYSDA,SPACE=(32000,(30,30)),
// DCB=(RECFM=FB,LRECL=3200,BLKSIZE=12800)
//SYSUT7 DD UNIT=SYSDA,SPACE=(32000,(30,30)),
// DCB=(RECFM=FB,LRECL=3200,BLKSIZE=12800)
//SYSUT8 DD UNIT=SYSDA,SPACE=(32000,(30,30)),
// DCB=(RECFM=FB,LRECL=3200,BLKSIZE=12800)
//SYSUT9 DD UNIT=SYSDA,SPACE=(32000,(30,30)),
// DCB=(RECFM=VB,LRECL=137,BLKSIZE=882)
//SYSUT10 DD DISP=SHR,DSN=&SYSUID..ADLAB.CDBG(TMC01A)
//SYSUT14 DD UNIT=SYSDA,SPACE=(32000,(30,30)),
// DCB=(RECFM=FB,LRECL=3200,BLKSIZE=12800)
//SYSUT16 DD UNIT=SYSDA,SPACE=(32000,(30,30)),
// DCB=(RECFM=FB,LRECL=3200,BLKSIZE=12800)
//SYSUT17 DD UNIT=SYSDA,SPACE=(32000,(30,30)),
// DCB=(RECFM=FB,LRECL=3200,BLKSIZE=12800)
//SYSLIN DD DUMMY
//SYSIN DD DSNAME=&SYSUID..ADLAB.SOURCE(TMC01A),DISP=SHR
//*
//*-------------------------------------------------------------------
//* COMPILE STEP2: COMPILE THE EXPANDED SOURCE FILE WITH THE DEBUG
//* COMPILER OPTION TEST
//*-------------------------------------------------------------------
//COMP2 EXEC PGM=CCNDRVR,REGION=0M,
// PARM=('TEST, AGGREGATE, NOIPA, LIST, NESTINC(255),',
// ' NOOFFSET, NOOPT, SOURCE, XREF, LONGNAME')
//STEPLIB DD DSNAME=&LEPRFX..SCEERUN2,DISP=SHR
// DD DSNAME=&CPRFX..SCCNCMP,DISP=SHR
// DD DSNAME=&LEPRFX..SCEERUN,DISP=SHR
//SYSMSGS DD DUMMY,DSN=&CPRFX..SCBC3MSG(EDCMSGE),DISP=SHR
//SYSLIB DD DSNAME=&LEPRFX..SCEEH.H,DISP=SHR
// DD DSNAME=&LEPRFX..SCEEH.SYS.H,DISP=SHR
//SYSCPRT DD DISP=SHR,DSN=&SYSUID..ADLAB.CLST(TMC01A)
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD UNIT=SYSDA,SPACE=(32000,(30,30)),
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=3200)
//SYSUT5 DD UNIT=SYSDA,SPACE=(32000,(30,30)),
// DCB=(RECFM=FB,LRECL=3200,BLKSIZE=12800)
//SYSUT6 DD UNIT=SYSDA,SPACE=(32000,(30,30)),
// DCB=(RECFM=FB,LRECL=3200,BLKSIZE=12800)
//SYSUT7 DD UNIT=SYSDA,SPACE=(32000,(30,30)),
// DCB=(RECFM=FB,LRECL=3200,BLKSIZE=12800)
//SYSUT8 DD UNIT=SYSDA,SPACE=(32000,(30,30)),
// DCB=(RECFM=FB,LRECL=3200,BLKSIZE=12800)
//SYSUT9 DD UNIT=SYSDA,SPACE=(32000,(30,30)),
// DCB=(RECFM=VB,LRECL=137,BLKSIZE=882)
//SYSUT10 DD SYSOUT=*
//SYSUT14 DD UNIT=SYSDA,SPACE=(32000,(30,30)),
// DCB=(RECFM=FB,LRECL=3200,BLKSIZE=12800)
//SYSUT16 DD UNIT=SYSDA,SPACE=(32000,(30,30)),
// DCB=(RECFM=FB,LRECL=3200,BLKSIZE=12800)
//SYSUT17 DD UNIT=SYSDA,SPACE=(32000,(30,30)),
// DCB=(RECFM=FB,LRECL=3200,BLKSIZE=12800)
//SYSLIN DD DSN=&&TEMOBJ1(TMC01A),DISP=(,PASS),UNIT=SYSDA,
// SPACE=(TRK,(20,20,20)),DCB=(RECFM=FB,BLKSIZE=3120,LRECL=80,DSORG=PO)
//SYSIN DD DSNAME=&SYSUID..ADLAB.CDBG(TMC01A),DISP=SHR
//*
//*-------------------------------------------------------------------
//* LINK STEP: LINK THE COMPILED OBJECT DECK
//*-------------------------------------------------------------------
//LKED EXEC PGM=IEWL,PARM=(LET,MAP,LIST)
//SYSLIB DD DSN=&LEPRFX..SCEELKED,DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSLMOD DD DISP=SHR,DSN=&SYSUID..ADLAB.LOAD
//SYSUT1 DD SPACE=(TRK,(10,10)),UNIT=SYSDA
//OBJECT DD DISP=(OLD,PASS),DSN=&&TEMOBJ1
//* DTLIB DD DSN=&DTPRFX..SEQAMOD,DISP=SHR
//SYSLIN DD *
INCLUDE OBJECT(TMC01A)
ENTRY CEESTART
NAME TMC01(R)
/*
//* INCLUDING A DEBUG TOOL LE EXIT (EQADBCXT, EQADDCXT, EQADICXT OR EQAD3CXT)
//* IS OPTIONAL. THE EXIT ENABLES STARTING DEBUG TOOL WITH THE
//* USER EXIT DATA SET UTILITY (ONE OF THE DEBUG TOOL ISPF UTILITIES).
//* AN INCLUDE CAN BE ADDED TO SYSLIN IN THE APPRORIATE SEQUENCE:
//* INCLUDE DTLIB(EQADBCXT)
//**************************************************************
//* GENERATE THE TMC01A EQALANGX FILE
//**************************************************************
//LANGX1 EXEC PGM=IPVLANGX,REGION=32M,
// PARM='(C ERROR'
//STEPLIB DD DISP=SHR,DSN=&LANGXLIB
// DD DISP=SHR,DSN=&LEPRFX..SCEERUN
//LISTING DD DSN=&SYSUID..ADLAB.CLST(TMC01A),DISP=SHR
//IDILANGX DD DSN=&SYSUID..ADLAB.EQALANGX(TMC01A),DISP=(OLD)