Tailoring Db2-supplied JCL procedures for preparing CICS programs

Instead of using the Db2 Program Preparation panels to prepare your CICS® program, you can tailor CICS-supplied JCL procedures to do that. To tailor a CICS procedure, you need to add some steps and change some DD statements.

About this task

Make changes as needed to perform the following actions:
  • Process the program with the Db2 precompiler.
  • Bind the application plan. You can do this any time after you precompile the program. You can bind the program either online by the DB2I panels or as a batch step in this or another z/OS® job.
  • Include a DD statement in the linkage editor step to access the Db2 load library.
  • Be sure the linkage editor control statements contain an INCLUDE statement for the Db2 language interface module.
The following example illustrates the necessary changes. This example assumes the use of a COBOL program. For any other programming language, change the CICS procedure name and the Db2 precompiler options.
         //TESTC01 JOB
         //*
         //*********************************************************
         //*       DB2 PRECOMPILE THE COBOL PROGRAM
         //*********************************************************
 (1)     //PC      EXEC PGM=DSNHPC,
 (1)     //       PARM='HOST(COB2),XREF,SOURCE,FLAG(I),APOST'
 (1)     //STEPLIB  DD  DISP=SHR,DSN=prefix.SDSNEXIT
 (1)     //         DD  DISP=SHR,DSN=prefix.SDSNLOAD
 (1)     //DBRMLIB  DD  DISP=OLD,DSN=USER.DBRMLIB.DATA(TESTC01)
 (1)     //SYSCIN   DD  DSN=&&DSNHOUT,DISP=(MOD,PASS),UNIT=SYSDA,
 (1)     //             SPACE=(800,(500,500))
 (1)     //SYSLIB   DD  DISP=SHR,DSN=USER.SRCLIB.DATA
 (1)     //SYSPRINT DD  SYSOUT=*
 (1)     //SYSTERM  DD  SYSOUT=*
 (1)     //SYSUDUMP DD  SYSOUT=*
 (1)     //SYSUT1   DD  SPACE=(800,(500,500),,,ROUND),UNIT=SYSDA
 (1)     //SYSUT2   DD  SPACE=(800,(500,500),,,ROUND),UNIT=SYSDA
 (1)     //SYSIN    DD  DISP=SHR,DSN=USER.SRCLIB.DATA(TESTC01)
 (1)     //*
         //********************************************************************
         //***    BIND THIS PROGRAM.
         //********************************************************************
 (2)     //BIND    EXEC PGM=IKJEFT01,
 (2)     //   COND=((4,LT,PC))
 (2)     //STEPLIB  DD  DISP=SHR,DSN=prefix.SDSNEXIT
 (2)     //         DD  DISP=SHR,DSN=prefix.SDSNLOAD
 (2)     //DBRMLIB  DD  DISP=OLD,DSN=USER.DBRMLIB.DATA(TESTC01)
 (2)     //SYSPRINT DD  SYSOUT=*
 (2)     //SYSTSPRT DD  SYSOUT=*
 (2)     //SYSUDUMP DD  SYSOUT=*
 (2)     //SYSTSIN DD *
 (2)      DSN S(DSN)
 (2)      BIND PLAN(TESTC01)  MEMBER(TESTC01) ACTION(REP) RETAIN ISOLATION(CS)
 (2)      END
         //********************************************************************
         //*            COMPILE THE COBOL PROGRAM
         //********************************************************************
 (3)     //CICS    EXEC DFHEITVL
 (4)     //TRN.SYSIN    DD  DSN=&&DSNHOUT,DISP=(OLD,DELETE)
 (5)     //LKED.SYSLMOD DD  DSN=USER.RUNLIB.LOAD
 (6)     //LKED.CICSLOAD DD  DISP=SHR,DSN=prefix.SDFHLOAD
         //LKED.SYSIN   DD  *
 (7)      INCLUDE CICSLOAD(DSNCLI)
          NAME TESTC01(R)
         //********************************************************************
The procedure accounts for these steps:
  • Step 1. Precompile the program. The output of the Db2 precompiler becomes the input to the CICS command language translator.
  • Step 2. Bind the application plan.
  • Step 3. Call the CICS procedure to translate, compile, and link-edit a COBOL program. This procedure has several options that you need to consider.
  • Step 4. Reflect an application load library in the data set name of the SYSLMOD DD statement. You must include the name of this load library in the DFHRPL DD statement of the CICS run time JCL.
  • Step 5. Name the CICS load library that contains the module DSNCLI.
  • Step 6. Direct the linkage editor to include the CICS-Db2 language interface module (DSNCLI). In this example, the order of the various control sections (CSECTs) is of no concern because the structure of the procedure automatically satisfies any order requirements.

For more information about the procedure DFHEITVL, other CICS procedures, or CICS requirements for application programs, please see the appropriate CICS manual.

If you are preparing a particularly large or complex application, you can use another preparation method. For example, if your program requires four of your own link-edit include libraries, you cannot prepare the program with DB2I, because DB2I limits the number of include libraries to three, plus language, IMS or CICS, and Db2 libraries. Therefore, you would need another preparation method. Be careful to use the correct language interface.