Further Considerations for Handling CICS Programs

When you put a program under test that contains EXEC CICS statements, you can use the CICS directive of the MFUPP preprocessor to ignore certain elements of the program: EXEC CICS statements, the dfheiblk copybook, and the DFH macros.

The recommended method for creating a framework to replace the ignored code is detailed in Using MFUPP to Mock a CICS Program. However, this example does not include a COMMAREA. If your program contains a DFHCOMMAREA field, your mocked code can use one by performing MFUPP--INIT-CICS (to allocate the area) in your test case, and then MFUPP--END-CICS to clear the area down; for example:

       ENTRY "MFUT_CICSHELLO".
         PERFORM MFUPP--INIT-CICS
         PERFORM <sec/para requiring commarea>
         PERFORM MFUPP--END-CICS

The size of the COMMAREA is automatically allocated based on the size from the original program; the size is stored in the EIBCALEN field.

Other fields that can be utilized within the sections of mocked code, to control the flow of the program when under test, are:

EIB field Description
EIBAID Aid key pressed
EIBCALEN Length of DFHCOMMAREA
EIBRCODE Return code of the last transaction
EIBTASKN Task number
EIBTRMID Terminal identifier
EIBTRNID Transaction identifier