CICS transactions can dynamically select a plan for execution by using a dynamic plan selection exit routine. By specifying PLNEXIT= with the TYPE=INIT statement, the same exit program can be specified for all Dynamic Plan Selection Table (DCTABPR) entries. Link edit the exit program into the CA Datacom CICS Services library that contains custom modules and is concatenated in the CICS startup JCL.
Note: To use this optional feature you must first assemble and link edit this exit. This program must be made Resident.
Specifying the Routine
To use a dynamic plan selection exit routine, specify the exit program's name in the Dynamic Plan Selection Table (DCTABPR). The three-step process is:
The exit program changes the plan that is to be allocated by changing the AUTHID value associated with the plan.
Coding the Plan Selection Exit Program
By using a plan selection exit program, the AUTHID value associated with the plan can be dynamically modified prior to command execution. The exit program is a user-written, command-level program. If each exit program is defined in the CICS tables, you can have a separate exit program for one or more Dynamic Plan Selection Table (DCTABPR) entries. For an example you can use when coding your own exit program, see Sample Exit Program. Requirements are as follows:
Exit Parameter List
A parameter list is passed to the exit program in DFHCOMMAREA when CA Datacom CICS Services links to the exit program. The following table shows the contents of the parameter list.
Name |
'Hex' Offset |
Data Type and Length |
Description |
---|---|---|---|
CSPLAN |
0 |
character |
Plan name of the first SQL statement on entry to the exit program. |
CSAUTHID |
7 |
character |
Current authorization ID that is invoked at execution time. This field is to be modified by the exit program to establish the use of a new plan (AUTHID plan). |
CSUSER |
19 |
character |
User area reserved for the exit program's use. This field is preserved between calls to the exit program. |
The CSUSER area function and use are intentionally general in nature. For example, CSUSER can be used to address a special user table or a CICS GETMAIN area. Each DCPLAN entry (with PLNEXIT=YES) has a unique CSUSER area.
DCTABPR Changes
Consider the following with regard to DCTABPR's PLNEXIT= parameter when you implement a dynamic plan selection routine:
Specifies the name of a system-level dynamic plan exit program.
Specifies a plan exit at the transaction level.
Specifies to use the system-level plan exit.
Design Consideration for Dynamic Plan Selection
For transactions designed without CICS SYNCPOINTs, dynamic plan selection is only available once (at first SQL call) during the life of the transaction. For transactions designed with CICS SYNCPOINTs, the exit is invoked for each new logical-unit-of-work (LUW).
Copyright © 2015 CA Technologies.
All rights reserved.
|
|