Dynamic plan exits

You are recommended to use packages rather than dynamic plan exits, because of the advantages that packages provide. The use of dynamic plan exits was an interim solution that was designed to address problems in the CICS® Db2® environment before packages were available in Db2.

You can design CICS applications around numerous small plans and select the plan dynamically at execution time. A small plan is not the same as a package, which has a strictly one-to-one correspondence to a database request module (DBRM).

Normally, a dynamic plan exit is driven to determine which plan to use at the start of the first unit of work (UOW) of the transaction. This is referred to as dynamic plan selection.

A dynamic plan exit can also be driven at the start of a subsequent UOW (assuming the thread was released at syncpoint) to determine what plan to use for the next UOW. The plan exit can decide to use a different plan. This is referred to as dynamic plan switching.

When a dynamic plan exit is used, Db2 plan allocation occurs only upon execution of the first SQL statement in a program, or after the program issues a syncpoint and links or transfers control to another program with a separate DBRM.

This is accomplished by using an exit program specified in:
  • DB2ENTRY, exit for a specific transaction code specified in the keyword PLANEXITNAME
  • DB2CONN, exit for transactions using the pool specified in the keyword PLANEXITNAME.

IBM® supplies two sample assembler language exit programs, DSNCUEXT and DFHD2PXT, in both source and object code form. You can also write other exit programs.

Note that the use of the following items within the dynamic exit program is not supported:
  • SQL commands.
  • IFI calls.
  • EXEC CICS SYNCPOINT commands.