Before you call a UTM function in a program, the KDCS parameter area must already have been supplied with all the necessary parameters.
These parameters include:
the operation code for the call
additional parameters determined by the operation code (see chapter "KDCS calls").
In some KDCS calls, unused parameter fields must be supplied with LOW-VALUE
. To avoid errors, you should always issue the command MOVE LOW-VALUE TO KCPAC
before supplying values to the parameter fields.
Format of the KDCS call
Once all the necessary data areas have been supplied, the KDCS call can be issued. The start address for all operations is "KDCS".
The format of the CALL is as follows:
CALL "KDCS" USING parm1[, parm2].
parm1 | is the data name of the KDCS parameter area. If the corresponding COPY member is used, the name is "KCPAC". This name must always be specified. |
parm2 | is the data name for the storage area in the program to which messages or data may need to be written or in which messages or data have been made available. In the present description, this area is generally referred to as “NB” (from the German acronym for message area). You can, however, choose any name you wish. |
The data names can be labeled if necessary.
The extended format would then be:
parm1 [{IN|OF} dataname1}...], [parm2 [{IN|OF} dataname2}...]].
For more details, refer to the description of the COBOL compiler.
Example
A data structure which exists more than once as a substructure is to be used as a message area.
. . 03 BOOK5. 05 DATX PIC X(50). . . . 03 BOOK8. 05 DATX PIC X(50). . .. CALL "KDCS" USING KCPAC, DATX IN BOOK5.
Event exits
The event exits INPUT, START, SHUT and VORGANG must not contain KDCS calls. They must be written as subroutines and must be terminated with the statement EXIT PROGRAM.
In the case of START, SHUT and VORGANG, the addresses for the communication area (KB) and the standard primary working area (SPAB) are passed in the PROCEDURE DIVISION. Accordingly, the structures of these areas are defined in the LINKAGE
SECTION (as for the program units with KDCS calls). In chapter "Programming examples in COBOL" is given an example of a combined START/SHUT exit.
In the case of the INPUT exit, openUTM passes the address of the INPUT parameter area. The COPY member KCINPC is available to help you structure the INPUT parameter area; the name of the data structure is KCINPUTC.
On BS2000 systems, you can also pass the address of a control field area. The COPY member KCCFC is available for the control field area; the name of the structure is KCCFILDC.
For further information on event exits see chapter "Event functions".
DATA DIVISION. ***************************************************************** WORKING-STORAGE SECTION. . . ****************************************************************** LINKAGE SECTION. COPY KCINPC. ***************************************************************** PROCEDURE DIVISION USING KCINPUTC [,KCCFILDC]. . .