Writing an edit routine in COBOL for native OS/390, ISPF, and TSO with language environment (LE)

The QMF edit exit interface of COBOL in native OS/390 and TSO consists of these parts:

Figure 175 shows the program structure of a COBOL edit exit routine in native OS/390 and TSO.

Figure 175. Program structure of a COBOL edit exit routine in TSO, ISPF, or native OS/390 with LE
QMF Main Module DSQQMF points to QMF Edit Exit Module DSQUEDIT  Entry: DBQUXILE
via Call. QMF Edit Exit Module which contains IBM-supplied QMF Control Program
 DSQUXILE and DEEPIPI User Edit Exit program DSQUXDT via Standard call to
LE points to  QMF Main Module via Return."> 
The edit control block
D

The edit control block DXEECSC and the sample COBOL program DSQUXCTC, as distributed by QMF, use quotes (") to delimit literals. If your installation or program uses apostrophes (') instead, you have to change DXEECSC or copy the structure to your program, changing quotes to apostrophes.

Example program DSQUXDTC

The IBM-supplied example edit exit program in COBOL, named DSQUXDTC, is located in QMF sample library QMF720.SDSQSAPE on OS/390. The example program is heavily commented; it can be browsed online, printed, or modified to suit your needs. If you plan to use this program, copy it to your program library and change its name to DSQUXDT.

How a COBOL edit routine interacts with native OS/390, TSO, or ISPF in LE

The user edit program is called as an LE subroutine. The following parameters are provided in the indicated order:

  1. DXEECS
  2. Input data
  3. Output data

An example procedure statement specifying parameters is as follows:

PROCEDURE DIVISION
        USING DXEECS, ECSINPT, ECSRSLT.
 

A COBOL data structure is shipped with QMF as DXEECSC, located in library QMF720.SDSQSAPE. Include this data structure in your program.

Return control to QMF using a standard subprogram GOBACK statement.

Compiling DSQUXDT

During the compile, QMF edit exit interface control block DXEECSC, located in QMF sample library QMF720.SDSQUSRE on OS/390 or on the QMF production disk on CMS, must be available in a macro library.

Compile the program with the following compile options:

OBJECT, LIB, RENT, RES, and NODYNAM.

Link-editing your program

Create a new QMF edit exit module DSQUEDIT by including your edit program DSQUXDT with the IBM-supplied control QMF module DSQUXILE (located in the QMF module library QMF720.SDSQLOAD on OS/390).

The module DSQUXILE must be specified as the entry point.

The module DSQUEDIT can be executed in either 24-bit or 31- bit addressing mode. QMF runs in 31-bit addressing mode and automatically switches to 24-bit addressing mode if the edit exit module DSQUEDIT has a 24-bit addressing mode.

Note
31-bit addressing mode is recommended.

Example statements for compiling and link-editing on OS/390

The following are example statements for compiling and link-editing your job for TSO or native OS/390:

  //samCOBOL   JOB
  //STEP1     EXEC PROC=IGYWCL
  //* Provide Access to QMF Edit Macro DXEECSC
  //COBOL.SYSLIB  DD  DSN=QMF720.SDSQUSRE,DISP=SHR
  //COBOL.SYSIN   DD  *

Your program or copy of QMF sample DSQUXDTC:

  /*
  //* Provide Access to QMF Interface Module
  //LKED.QMFLOAD  DD DSN=QMF720.SDSQLOAD,DISP=SHR
  //LKED.SYSLIB   DD ...
  //                DD DSN=&&TEMPOBJ,DISP=(OLD,PASS)
  //                DD DSN=SYS1.SCEELKED,DISP=SHR
  //LKED.SYSIN    DD  *
            INCLUDE QMFLOAD(DSQUXILE)
            ENTRY DSQUXILE
            MODE  AMODE(31) RMODE(ANY)
            NAME  DSQUEDIT(R)
  /*
[ Previous Page | Next Page | Contents | Index ]