Calling your exit routine on VM

Figure 158 shows how QMF and your edit exit routine work together to format data using the edit codes you define.

Figure 158. How a user edit routine works with QMF for VM
DB2 Data connects to QMF Form which connects to QMF Interface  Control Block
which connect to User-written Edit Exit Routine which connects to another
QMF  Interface Control Block which connects to QMF Report.

When you enter your own code in a column of FORM.MAIN or FORM.COLUMNS, QMF passes certain characteristics of the data into the first interface control block. These characteristics reside in specific fields of the control block, which are discussed in Fields of the Interface control block. QMF also passes into the input area the data to be formatted and an output area that holds the formatted result.

IBM supplies three different versions of a sample edit exit routine. One version is for assembler (DSQUXDTA), one is for PL/I (DSQUXDTP), and one is for COBOL (DSQUXDTC).

The sample program supports two edit codes:

VSS
Adds dashes to a social security number or a character string.
UDN
Transforms a department number into its department name, using a table internal to the program.

The sample program is commented so you can more easily see how a user edit routine works. You can use the sample as a template for creating your own program. These routines can be found on the QMF production disk on CMS.

QMF supplies the user edit routine, DSQUEDIT, for CMS. DSQUEDIT is a relocatable module file and a text file on the QMF production disk. Delete or rename the QMF-supplied module and text file when you are ready to use your edit routine.

VM Note: The use of a relocatable module file facilitates user edit code development because a module file on the user's A-disk can be tested without renaming or deleting the QMF-supplied user edit routine from the QMF production disk. This reduces the impact on other QMF users. Once you have written and assembled or compiled your edit routine, you need to consider the method of making your routine available to QMF for execution. The user edit routine can be executed in text or module format. The use of a relocatable CMS module file is the preferred method of generating a user edit routine.

When QMF for VM is started, QMF attempts to load the edit routine as follows:

  1. Issue CMS NUCXLOAD for DSQUEDIT. NUCXLOAD loads a CMS module file that has relocation information saved, or as a member of an OS load library.
  2. Issue OS LOAD (SVC 8) for DSQUEDIT. If use of NUCXLOAD is not successful, QMF then issues an OS LOAD (SVC 8). OS LOAD loads a text file, a member of a TXTLIB, or a member of an OS load library.

Different versions of the interface control block are used for Assembly, PL/I, and COBOL edit routines. However, the fields of the control block and the input they contain are the same regardless of the programming language the routine is written in. Figure 159 shows the general structure of the edit routines.

Figure 159. General program structure for edit routines
QMF Main Module DSQQMF points to QMF Edit Exit Module  DSQUEDIT and DSQUECIC
(CICS only). The QMF Edit Exit Module, which contains IBM supplied Control
Programs and User exit edit program DSQUXDT, points back to QMF Main Module.
[ Previous Page | Next Page | Contents | Index ]