Using the COMMAREA in the sample programs

Data is passed between the sample client and server programs using a standard CICS® communications area (COMMAREA) for passing data between programs. The definitions of this COMMAREA are identical on each side of the EXCI link to ensure that data is mapped correctly.

The sample client program DFH$AXCC minimizes data transmission by specifying a specific data length to avoid sending the whole COMMAREA over the link. The data length option specifies a binary value that is the length of a contiguous area of storage, from the start of the COMMAREA, to be passed to the server program. This is because the amount of data being passed to the server is small, but the COMMAREA itself is much larger so that the server can return the requested records from FILEA. Specifying a data length when the amount of data being passed is smaller than the COMMAREA improves performance.

Sample program DFH$ATXC passes the full COMMAREA to the server program because it makes changes to the file records and the whole of the changed record needs to be passed to the server.

The first and third sections of the sample client programs define the COMMAREA as only 18 bytes (no data is requested from the server in these sections). For the second section, the sample client program defines the COMMAREA as 98 bytes, the extra 80 bytes being required for the sample server program to return a record from FILEA. In all sections, the data length is defined as 18 bytes. The COMMAREA structure is defined in the sample programs as follows:
Bytes Data type Field description
0-3 Fullword Call type code.
4-11 Char(8) Target file name.
12-17 Char(6) Ridfield identifier.
18-97 Char(80) FILEA record data area.

Note that, although the COMMAREA structure is described in both the client and server programs, the actual size of the COMMAREA made available by CICS to the server is determined by the client program. If you modify the sample programs to work with one of your own application programs, make sure you specify a COMMAREA large enough to handle the maximum amount of data the server is expected to return to the client. The server must not attempt to return data that is larger than the COMMAREA specified by the client.

For more information about using a COMMAREA for passing data between CICS programs, see Sharing data across transactions.