Calling a CICS wrapper program to integrate the code

If you use the CICS® usage option when you generate the COBOL code, you must also update the CICS calling program so that it calls the wrapper program to execute the COBOL program for rule execution.

About this task

Deprecated feature:

Deprecation icon The COBOL code generation feature is deprecated in V8.5. This feature will be removed in a future release of the product. Use the COBOL Generation Project Migration wizard to migrate your Rules for COBOL project to a zRule Execution Server for z/OS compatible rule project. See Deprecated features for migration details.

If you want to host the generated COBOL program in a different CICS region to the calling application, you can use the CICS usage option. In this case, the COBOL code generator generates a CICS wrapper program, as well as the COBOL code for rule execution. If you use the CICS usage option, you must also update the CICS calling program so that it calls the wrapper program to execute the COBOL program for rule execution.

Procedure

To update the CICS calling program:

  1. Add an EXEC CICS PUT CONTAINER statement for each group item.

    For example, if you have two group items, LOAN and BORROWER, you might create the following statements:

    EXEC CICS PUT CONTAINER(LOAN-CONTAINER)
                  CHANNEL(MINILOAN-CHANNEL)
                  FROM(Loan) FLENGTH(Length of Loan)
                  END-EXEC
    
    EXEC CICS PUT CONTAINER(BORROWER-CONTAINER)
                  CHANNEL(MINILOAN-CHANNEL)
                  FROM(Borrower) FLENGTH(Length of Borrower)
                  END-EXEC
    
  2. Replace the COBOL call statement with an EXEC CICS LINK PROGRAM statement that specifies the name of the channel that you want to pass to the wrapper program.
  3. Add an EXEC CICS GET CONTAINER statement for each Top Level data item modified by the generated COBOL program.

    You must have the GET CONTAINER commands to get any information from the containers that has been modified by the COBOL program. The GET CONTAINER command picks up the information from the PUT CONTAINER command at the end of the wrapper program.

    Note: If the generated COBOL program increases the size of a data item, for example, if the generated program modifies an OCCURS DEPENDING ON variable, use COBOL pointers to retrieve the data.

Results

You can now translate, compile and link the calling program, the wrapper program, and the generated COBOL code. This action is slightly different from a normal COBOL compile because all the EXEC CICS statements must be translated to compile the code successfully.