IBM SC34-6814-04 Server User Manual


 
If a CICS DB2 application program has been written and defined as threadsafe to
obtain the benefits of the CICS open transaction environment (OTE), the benefit is
lost if TCB switching is caused by a non-threadsafe exit program. You should pay
particular attention to exit programs used on the mainline CICS-DB2 path: exit
programs written for the XRMIIN and XRMIOUT exit points need to be made
threadsafe, as well as those invoked frequently, such as XEIIN and XEIOUT, which
are invoked for every CICS API request.
To ensure that global user exit programs (such as those that run at the recovery
exit points) are available as early as possible during CICS initialization, it is
common practice to enable them from first-phase PLT programs. If you do this, bear
in mind that, because first-phase PLT programs run so early in CICS initialization,
no resource definitions are available. This means that you cannot use installed
PROGRAM definitions (or the program autoinstall user program) to define the exit
programs to CICS. Instead, default definitions are installed automatically by CICS.
(This is known as “system-autoinstall”.) Note that this happens whether or not
program autoinstall is specified as active on the PGAIPGM system initialization
parameter. The autoinstall user program is not invoked to allow the definitions to be
modified.
CICS installs exit programs that are enabled from first-phase PLT programs with
CONCURRENCY(QUASIRENT); that is, the exit programs are defined as
quasi-reentrant. To define a first-phase PLT global user exit program as threadsafe,
specify the THREADSAFE keyword on the EXEC CICS ENABLE command. This
overrides the CONCURRENCY(QUASIRENT) setting on the system-autoinstalled
program definition. For more information about first-phase PLT programs, see
“First-phase PLT programs” on page 425.
For more information, see the CICS Application Programming Guide.
Sample global user exit programs
CICS provides two sets of sample and example global user exit programs.
1. A set that shows you how to do basic things, such as:
v Enable a global user exit program and allocate a global work area
v Use EXEC CICS and XPI commands in a global user exit program.
2. A set of samples for use at specific global user exit points.
The source of all the sample programs and any associated copy books is supplied
in the CICSTS32.CICS.SDFHSAMP library. You can use the supplied programs as
models on which to base your own versions.
Basic sample and example programs
CICS supplies a number of samples to use when creating your global user exit
programs.
Global work area (GWA) sample exit programs
This set of sample programs shows you how to:
v Enable a global user exit program and allocate a global work area (GWA).
v Obtain the address of an exit program’s GWA.
v Access CICS system information, and make that information available to other
global user exit programs.
Chapter 1. Global user exit programs 15