Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

Data structures for COBOL program units

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:
This area allows you to select OSI TP function combinations and the security type.

KCATC

KDCS attribute functions (only on BS2000 systems):
Where +formats are used, you can use the symbolic names for attribute functions to modify the attribute fields for formats.

KCCFC

Only on BS2000 systems:
Defines the second parameter passed by openUTM for the event exit INPUT. In this parameter openUTM passes the contents of the control fields in screen formats to the program unit. For this reason, this second parameter is also referred to as the control fields area.

KCDADC

Data structure for the DADM call:
You should place this data structure over the message area for the KDCS call DADM RQ.

KCDFC

KDCS screen functions:
You can use this symbolic name to influence the screen output by entering the name of the function you want in the KCDF field in the KDCS parameter area.

KCINFC

Data structure for the INFO call:
You should place this data structure over the message area for the KDCS call INFO DT/SI/PC.

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:
This data structure contains the input and output parameters for the INPUT exit.

KCKBC

Data structure for the KDCS communication area. It contains:

  • current service and program data

  • data returned to UTM after a call

  • (if required) the KB program area for passing data between programs within a service. You will also need to define the fields in the KB program area.

KCMSGC

Data structure for the UTM messages:
You will need this data structure if you have to handle UTM messages in a MSGTAC routine or if you want to use a program you have written to analyze the SYSLOG file. 

KCOPC

KDCS operation codes:
This data structure contains symbolic names for the KDCS operations. For your KDCS calls you can enter a name in the KCOP field in the KDCS parameter area. Please note that the symbolic name for the SIGN call is SGN.

KCPAC

Data structure for the KDCS parameter area:
This area accepts the parameters for a KDCS call.

KCPADC

Data structure for the PADM call:
You should place this data structure over the message area for the KDCS call PADM AI/PI.

KCSGSTC

Data structure for the SIGN call:
You should place this data structure over the message area for the KDCS call SIGN ST with KCLA > 0.

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.

Example
 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.