To help you structure your data areas, openUTM is supplied with the following COPY members containing predefined data structures:
On BS2000 systems the data structures are present in the library SYSLIB.UTM.070.COB.
On Unix, Linux and Windows systems the data structures are present in the directory copy-cobol85 or netcobol in the UTM diectory utmpath.
Name | Contents and meaning |
---|---|
KCAPROC | Optional second parameter area for the APRO call: |
KCATC | KDCS attribute functions (only on BS2000 systems): |
KCCFC | Only on BS2000 systems: |
KCDADC | Data structure for the DADM call: |
KCDFC | KDCS screen functions: |
KCINFC | Data structure for the INFO call: |
KCINIC | Defines a second parameter area for the INIT call (only necessary for INIT PU) and optional for the PGWT call (if KCLI > 0). UTM returns the requested information in this parameter area. |
KCINPC | Data structure for the INPUT exit: |
KCKBC | Data structure for the KDCS communication area. It contains:
|
KCMSGC | Data structure for the UTM messages: |
KCOPC | KDCS operation codes: |
KCPAC | Data structure for the KDCS parameter area: |
KCPADC | Data structure for the PADM call: |
KCSGSTC | Data structure for the SIGN call: |
The data structures KCOPC, KCATC and KCDFC define constants. You should therefore copy these area to the WORKING-STORAGE SECTION.
Copy the remaining data structures to the LINKAGE SECTION.
The data structures will be copied to the program unit as illustrated in the example below.
DATA DIVISION. ***************************************************************** WORKING-STORAGE SECTION. COPY KCOPC. COPY KCATC. *** (only on BS2000 systems) COPY KCDFC. ****************************************************************** LINKAGE SECTION. COPY KCKBC. 05 KBPRG PIC X(80). COPY KCPAC. COPY KCINFC. 05 FILLER PIC X(50). 03 NB REDEFINES KCINFC. ***************************************************************** PROCEDURE DIVISION USING KCKBC, KCSPAB. . . .
Command section in a COBOL program unit
The command section of a COBOL program unit is freely definable. There are merely a few transaction processing rules, as described in chapter "Structure and use of UTM programs", which you need to note:
program units are subroutines of the UTM main routine KDCROOT
program units have to be reentrant
dialog program units must strictly adhere to the rules governing dialogs.
Event exits are subject to special rules which are described in chapter "KDCS calls in COBOL program units".
Passing addresses
The PROCEDURE DIVISION in a COBOL program unit begins with the following statement:
PROCEDURE DIVISION USING kckbc[, spab[, param1 [, ... paramn ]]]
kckbc | is the name of the KDCS communication area which must be defined with the level number 01 in the LINKAGE SECTION. Where the COPY member KCKBC is used, the name is KCKBC. |
spab | is the name of the standard primary working area defined with the level number 01 in the LINKAGE SECTION. Where the COPY member KCPAC is used, the name is KCSPAB. If an area from the WORKING-STORAGE SECTION was used in place of the SPAB, this specification is omitted. |
param1 ... paramn | are the names of further objects defined in the LINKAGE SECTION; see heading "Extending the LINKAGE SECTION" in section "COBOL program units as subroutines". These objects can, for example, be AREAs which serve as an extension of the SPAB. If no such objects are used, this specification is omitted. |