Writing your own exit program

You can write your exit program in assembler , COBOL, or PL/I.

About this task

The exit program is a CICS program, which means it must:
  • Adhere to normal CICS conventions.
  • Be defined to CICS (unless program autoinstall is being used.
  • Use CICS command level statements.
  • Return to CICS using an EXEC CICS RETURN command.

The CICS DB2 attachment facility program passes a parameter list to the exit program using a COMMAREA. The exit program can change the default plan name (DBRM name) supplied in the parameter list, when the first SQL statement is processed by the CICS DB2 attachment facility. The name specifies the plan name for this execution of the transaction.

If CICS is connected to DB2 Version 7 or later, then as explained in Enabling CICS DB2 applications to use OTE through threadsafe programming , you should ensure that the logic in your dynamic plan exit is coded to threadsafe standards, and that the program is defined as threadsafe (like the sample exit program DFHD2PXT). If the program is not defined as threadsafe, each use of the program causes a switch back to the QR TCB, incurring an additional cost. If the program is defined as threadsafe but uses non-threadsafe CICS commands (which is permitted), each non-threadsafe command causes a switch back to the QR TCB and incurs the additional cost.