Running your COBOL programs in TSO

The following sections provide sample JCL to run the COBOL compiler and linkage editor and sample programs for running your complied programs in TSO either with or without ISPF.

Compiling and link-editing in TSO

The following job uses the COBOL compiler to compile your callable interface application. It then link-edits your application. Some parameters might vary from one installation to the next. See your QMF administrator for details.

Figure 49. JCL to run the COBOL compiler and linkage editor
//samCOBOL   JOB
//STEP1      EXEC PROC=IGYWCL
//* Provide Access to QMF Communications Macro DSQCOMM
//COBOL.SYSLIB   DD  DSN=QMF720.SAMPLIB,DISP=SHR
//COBOL.SYSIN    DD  *
          .
          Your program or copy of QMF sample DSQABFCO
          .
/*
//* Provide Access to QMF Interface Module
//LKED.QMFLOAD  DD DSN=QMF720.SDSQLOAD,DISP=SHR
//LKED.SYSIN    DD  *
          INCLUDE QMFLOAD(DSQCIB)
          ENTRY samCOBOL
          MODE  AMODE(31) RMODE(ANY)
          NAME  samCOBOL(R)
/*

Running your programs in TSO without ISPF

After you successfully compile your program, you can run it by writing a program similar to the following:

Figure 50. JCL to run the COBOL compiler and linkage editor
PROC 0
CONTROL ASIS
/************************************************************/
/* Note: QMF, DB2, GDDM and COBOL load libraries must be    */
/*       allocated before running this CLIST.               */
/*       Name of QMF load library is  "QMF720.SDSQLOAD".    */
/************************************************************/
/* Specify attribute list for dataset allocations           */
/************************************************************/
ATTR PRINTDCB LRECL(133) RECFM(F B A) BLKSIZE(1330)
ATTR DEBUGDCB LRECL(80)  RECFM(F B)   BLKSIZE(3120)
ATTR UDUMPDCB LRECL(125) RECFM(V B A) BLKSIZE(1632)
ATTR EDITDCB  LRECL(79)  RECFM(F B A) BLKSIZE(4029)
/************************************************************/
/* Datasets used by TSO                                     */
/************************************************************/
ALLOC FI(SYSPROC) DA('QMF720.SDSQCLTE')
ALLOC FI(SYSEXEC) DA('QMF720.SDSQEXCE')
/************************************************************/
/* QMF/GDDM Datasets                                        */
/************************************************************/
ALLOC FI(ADMGGMAP) DA('QMF720.QMFMAPS')  SHR REUSE
ALLOC FI(ADMCFORM) DA('QMF720.DSQCFORM') SHR REUSE
ALLOC FI(DSQUCFRM) DA('QMF720.DSQUCFRM') SHR REUSE
ALLOC FI(ADMSYMBL) DA('ADM.GDDMSYM')  SHR REUSE
ALLOC FI(ADMGDF)   DA('ADM.GDDM.CHARTLIB') SHR REUSE
ALLOC FI(ADMDEFS)  DA('ADM.GDDM.NICKNAME') SHR REUSE
/************************************************************/
/* Datasets used by QMF                                     */
/************************************************************/
ALLOC FI(DSQPRINT) SYSOUT(X) USING(PRINTDCB)
ALLOC FI(DSQDEBUG) SYSOUT(X) USING(DEBUGDCB)
ALLOC FI(DSQUDUMP) SYSOUT(X) USING(UDUMPDCB)
ALLOC FI(DSQSPILL) NEW UNIT(SYSDA) SPACE(1,1) TRACKS
ALLOC FI(DSQEDIT)  NEW UNIT(SYSDA) USING(EDITDCB)
ALLOC FI(DSQPNLE)  DA('QMF720.DSQPNLE') SHR REUSE
/************************************************************/
/* Start your program using TSO CALL command                */
/************************************************************/
CALL samCOBOL
EXIT CODE(0)

Running your programs in TSO under ISPF

After you successfully compile your program, you can run it by writing a program similar to the following:

Figure 51. CLIST for running your program in TSO under ISPF
PROC 0
CONTROL ASIS
/************************************************************/
/* Specify attribute list for dataset allocations           */
/************************************************************/
ATTR PRINTDCB LRECL(133) RECFM(F B A) BLKSIZE(1330)
ATTR DEBUGDCB LRECL(80)  RECFM(F B)   BLKSIZE(3120)
ATTR UDUMPDCB LRECL(125) RECFM(V B A) BLKSIZE(1632)
ATTR EDITDCB  LRECL(79)  RECFM(F B A) BLKSIZE(4029)
/************************************************************/
/* Datasets used by TSO                                     */
/************************************************************/
ALLOC FI(SYSPROC) DA('QMF720.SDSQCLTE','ISR.ISRCLIB')
ALLOC FI(SYSEXEC) DA('QMF720.SDSQEXCE')
/************************************************************/
/* Datasets used by ISPF                                    */
/************************************************************/
ALLOC FI(ISPLLIB) SHR REUSE +

      DA('QMF720.SDSQLOAD','ADM.GDDMLOAD','DSN.DSNEXIT','DSN.DSNLOAD', +
         'PRDUCT.COB2LIB')
ALLOC FI(ISPMLIB) SHR REUSE +
      DA('QMF720.SDSQMLBE','ISR.ISRMLIB','ISP.ISPMLIB')
ALLOC FI(ISPPLIB) SHR REUSE +
      DA('QMF720.SDSQPLBE','ISR.ISRPLIB','ISP.ISPPLIB')
ALLOC FI(ISPSLIB) SHR REUSE +
      DA('QMF720.SDSQSLBE','ISR.ISRSLIB','ISP.ISPSLIB')
ALLOC FI(ISPTLIB) SHR REUSE +
      DA('ISR.ISRTLIB','ISP.ISPTLIB')
/************************************************************/
/* QMF/GDDM Datasets                                        */
/************************************************************/
ALLOC FI(ADMGGMAP) DA('QMF720.QMFMAPS')  SHR REUSE
ALLOC FI(ADMCFORM) DA('QMF720.DSQCFORM') SHR REUSE
ALLOC FI(DSQUCFRM) DA('QMF720.DSQUCFRM') SHR REUSE
ALLOC FI(ADMSYMBL) DA('ADM.GDDMSYM')  SHR REUSE
ALLOC FI(ADMGDF)   DA('ADM.GDDM.CHARTLIB') SHR REUSE
ALLOC FI(ADMDEFS)  DA('ADM.GDDM.NICKNAME') SHR REUSE
/************************************************************/
/* Datasets used by QMF                                     */
/************************************************************/
ALLOC FI(DSQPRINT) SYSOUT(X) USING(PRINTDCB)
ALLOC FI(DSQDEBUG) SYSOUT(X) USING(DEBUGDCB)
ALLOC FI(DSQUDUMP) SYSOUT(X) USING(UDUMPDCB)
ALLOC FI(DSQSPILL) NEW UNIT(SYSDA) SPACE(1,1) TRACKS
ALLOC FI(DSQEDIT)  NEW UNIT(SYSDA) USING(EDITDCB)
ALLOC FI(DSQPNLE)  DA('QMF720.DSQPNLE') SHR REUSE
/************************************************************/
/* Start your program as the initial ISPF dialog            */
/************************************************************/
ISPSTART PGM(samCOBOL) NEWAPPL(DSQE)
EXIT CODE(4)

The EXIT CODE(4) suppresses the showing of the ISPF disposition panel.

[ Previous Page | Next Page | Contents | Index ]