Demonstration Application

We supply two sample CICS programs for use in this tutorial, INCCA.cbl and SECCA.cbl, both located in the %PUBLIC%\Documents\Micro Focus\Enterprise Developer\Samples\Mainframe\Interface Mapping Toolkit\Classic\ServiceInterfaces\CommareaDemo directory by default. You can also access them from the Samples Browser.

To help you become familiar with the programs' respective commareas and logic, review the following:
INCCA.cbl
INCCA.cbl calls the copybook, INCOM.cpy, which contains the following commarea:
01  dfhcommarea.
          03 int-fld    pic 9(5).
          03 comp-fld   pic 99v99 comp-3.
          03 dec-fld    pic 999v99.
          03 disp-fld    pic 9(4) display.
          03 string-fld pic x(80).
          03 grp-fld    occurs 5.
             05 individual-item-fld pic 9(3) occurs 3.

All fields are input/output fields, with the exception of the grp-fld array, which is an output field.

The logic in INCCA.cbl takes numeric values as input for the int-fld, comp-fld, dec-fld and disp-fld fields, and adds a fixed value to those fields. The value of string-fld is not changed. The grp-fld array receives numeric values. The logic code is:
           add 1 to int-fld
           add 1.25 to comp-fld
           add 1.50 to dec-fld
           add 10 to disp-fld
           move 100 to individual-item-fld(1, 1)
           move 100 to individual-item-fld(1, 2)
           move 100 to individual-item-fld(1, 3)
           move 200 to individual-item-fld(2, 1)
           move 200 to individual-item-fld(2, 2)
           move 200 to individual-item-fld(2, 3)
           move 300 to individual-item-fld(3, 1)
           move 300 to individual-item-fld(3, 2)
           move 300 to individual-item-fld(3, 3)
           move 400 to individual-item-fld(4, 1)
           move 400 to individual-item-fld(4, 2)
           move 400 to individual-item-fld(4, 3)
           move 500 to individual-item-fld(5, 1)
           move 500 to individual-item-fld(5, 2)
           move 500 to individual-item-fld(5, 3)
SECCA.cbl
The commarea in SECCA.cbl is defined within the program:
01  dfhcommarea pic x(180).
Also defined within the program is the following group of Working Storage fields used to modify the commarea:
       01 wrkcommarea.
           03 in-string pic x(80).
           03 out-string pic x(100).
The program logic here is simple. As shown in the following code, the program moves the entire contents of the dfhcommarea field to the wrkcommarea field in Working Storage, modifies the contents, and then moves the contents back to the dfhcommarea field before returning:
         move dfhcommarea to wrkcommarea
           string 'SECCA received: ' delimited by size
             in-string delimited by size
             into out-string
           move wrkcommarea to dfhcommarea