Running your COBOL programs in CICS

After you write your program, you need to translate, compile, and link-edit it as required before you can run it. The programs listed in this section show the steps necessary to do so.

QMF does not ship the REXX EXEC, JCL, or CLIST in these examples, but you can copy them from here, altering them to suit your installation.

Translating, compiling, and link-editing for CICS in MVS

The following example shows the CICS supplied procedure DFHEBTVL, which supports COBOL. See the CICS library for details on how to translate programs for use in CICS.

Figure 46. JCL to run the CICS translator, COBOL compiler, and linkage editor
//samCOBOL  JOB
//          EXEC PROC=DFHEBTVL
//TRN.SYSIN DD  *
*CBL      XOPTS(CICS translator options ...QUOTE COBOL2)
          .
          Your program or copy of QMF sample DSQABFCO
          .
/*
//* Provide Access to QMF Communications Macro DSQCOMMB
//COB.SYSLIB   DD DSN=QMF720.SDSQSAPE,DISP=SHR
//* Provide Access to QMF Interface Module
//LKED.QMFLOAD DD DSN=QMF720.SDSQLOAD,DISP=SHR
//LKED.SYSIN   DD *
          INCLUDE CICSLOAD(DFHECI)
          INCLUDE QMFLOAD(DSQCIB)
          ORDER DFHECI
          ENTRY samCOBOL
          MODE  AMODE(31) RMODE(ANY)
          NAME  samCOBOL(R)
/*

Translating, compiling, and link-editing for CICS in VSE

The VSE job control in Figure 47 is an example of installing a COBOL program into CICS running on VSE. See the CICS library for details on how to translate and compile your COBOL programs.

This example, shipped with QMF, is located in the QMF sublibrary and is named DSQ3CICO.Z.

Figure 47. Job control to run the CICS/VSE translator, COBOL compiler, and linkage editor
* $$ JOB JNM=DSQ3CICO,DISP=D,CLASS=0
// JOB DSQ3CICO   Sample job to Install QMF Callable Interface (COBOL)
*  --------------------------------------------------------------------
*  Install QMF Callable Interface Example (COBOL)
*  ---------------------------------------------------------------------
// SETPARM VOLID=volid      *-- update volid for syspch
// SETPARM START=rtrk       *-- update start track/block (syspch)
// SETPARM SIZE=ntrks       *-- update number of tracks/blocks (syspch)
*  ---------------------------------------------------------------------
// DLBL   IJSYSPH,'CICS.TRANSLAT.OUTPUT',0
// EXTENT SYSPCH,,1,0,&START,&SIZE
ASSGN SYSPCH,DISK,VOL=&VOLID,SHR
*  Library search chain must contain the QMF, CICS and COBOL sublibrary
// LIBDEF *,SEARCH=(PRD2.PROD,PRD1.BASE,PRD2.CONFIG)
// LIBDEF PHASE,CATALOG=PRD2.PROD
*  --------------------------------------------------------------------
*  Step 1: Translate callable interface program (COBOL)
*  ---------------------------------------------------------------------
*  You may need to update or remove the SLI statement for your program.
*  ---------------------------------------------------------------------
// EXEC   DFHECP1$,SIZE=256K,PARM='XOPTS(CICS,QUOTE)'
* $$ SLI MEM=DSQABFCO.Z,S=PRD2.PROD
/*
*  ---------------------------------------------------------------------
*  Step 2: Compile callable interface program (COBOL)
*  ---------------------------------------------------------------------
CLOSE SYSPCH,00D
// DLBL   IJSYSIN,'CICS.TRANSLAT.OUTPUT',0
// EXTENT SYSIPT
ASSGN SYSIPT,DISK,VOL=&VOLID,SHR
// OPTION NODECK,CATAL
   PHASE DSQABFCO,*
         INCLUDE DFHECI
// EXEC IGYCRCTL,PARM='SZ(MAX),OBJECT,MAP,RES,NODYNAM,QUOTE,LIB,RENT'
CLOSE SYSIPT,SYSRDR
/*
*  ---------------------------------------------------------------------
*  Step 3: Link-edit callable interface program (COBOL)
*  ---------------------------------------------------------------------
// EXEC LNKEDT,PARM='AMODE=31,RMODE=ANY'
/*
/&
// JOB  RESET
ASSGN SYSIPT,SYSRDR    IF 1A93D, CLOSE SYSIPT,SYSRDR
ASSGN SYSPCH,00D       IF 1A93D, CLOSE SYSPCH,00D
/&
* $$ EOJ
[ Previous Page | Next Page | Contents | Index ]