CICS program list tables: PLTPI and PLTSD programs
CICS expert Robert Crawford describes the two types of program list tables (PLT)
In addition to the exits and user replaceable modules (URM) that make CICS a highly customizable environment, there are program list tables (PLT). PLTs come in two flavors: post-initialization (PLTPI) and shutdown (PLTSD), both of which are specified in the system initialization table (SIT). In either case these PLT's provide another opportunity for installations to make system modifications.
Table Structure
More on CICS tables:
Adding and deleting CICS data tables
Searching tables for reference data
PLTs are still defined with macros compiled into load modules named DFHPLTss where "ss" is the suffix specified in the initial macro. Note that you don't specify the PLT type at definition time. The table's use depends on how CICS uses it, which is based on the PLTPI and PLTSD SIT parameters.
Like all CICS tables, the first macro specifies TYPE=INITIAL followed by individual entries. Each PLT entry is simply a program name. The only exceptions are the keyword entries with the program name DFHDELIM, which CICS uses to distinguish which phase of start-up or shutdown a program is supposed to run.
At the beginning phase of either type of PLT processing, CICS performs an EXEC CICS LINK to each program listed in the table until it reaches the DFHDELIM entry. At that point CICS waits until the next phase. Then it restarts processing the list where it left off. Note that CICS goes through the programs in the order they're listed. Therefore, you should be aware of any PLT program interdependencies when updating the table.
The PLT tables themselves are treated as ordinary programs and may even be newly copied after CICS initializes. As such, they should be defined in RDO or through program auto-install.
Execution
Programs in PLTPI run during system initialization as specified in the SIT PLTPI parameter and run in one of two phases. The first starts before all CICS facilities are fully initialized. For this reason, programs running at this time shouldn't use any CICS resources, or, at most, storage. IBM recommends using this phase to enable user exits needed for recovery only. The second phase executes after CICS is fully initialized but before any user transactions run or any terminal input.
PLTPI programs are useful for doing things such as:
- Enabling task related (TRUE) or global (GLUE) user exits
- Initializing an environment for system level or vendor code
- Automating application initialization
On the flip side, there is the PLTSD which also has two phases. Initially there is the "first quiesce" phase immediately after CICS shutdown starts. A program in this phase may assume it can use any CICS facility although there may be a few restrictions. After that comes the "final quiesce" phase where terminals aren't available and new tasks can't be started. Programs running in the final quiesce stage should not try to use database facilities, such as DB2.
The PLTSD programs may be useful for things like:
- Writing buffered information to a file
- "Hardening" some application information that may be kept in memory or any type of necessary application shutdown.
- Notifying applications in other regions that current system is becoming unavailable.
An additional limitation is that PLTSD processing may not take place if CICS shutdown stalls or ABEND's. If you're relying on PLTSD to save some data you'd better have a backup plan.
Programming
There are a few restrictions on what a PLTPI program can do. Since there's no terminal associated with the PLTPI transaction, a program may not do any terminal I/O, including IRC or ISC. A PLTPI program shouldn't put itself into any waits, internal or external, or cause CICS startup to stall significantly. Any tasks initiated with a START command will be delayed until PLTPI processing completes. Be aware that PLTPI programs run under transaction CPLT and will inherit the CICS' system security. PLTPI programs must be defined to run in the CICS execution key.
PLTSD programs running in the first quiesce phase can still do some terminal work and start transactions. However, any transactions started at this point either must be in the shutdown transaction list (XLT) or defined in RDO as being able to run during system shutdown. As you might have guessed, programs running in the second shutdown phase are even more restricted. They cannot interact with terminals nor use many system services to database interfaces.
A program can tell which processing phase CICS' is in through the EXEC CICS INQUIRE SYSTEM command. The CICSSTATUS operand provides a value indicating the stage of CICS' execution.
Another problem PLT programs have is input. With the lack of an input facility like a terminal may be difficult for a PLT program to be able to know what to do. Fortunately, CICS provides the INITPARM SIT override parameter. INITPARM takes the form of a keyword/value pair where the keyword is the program the parameter is meant for. Following the program name is the actual parameter, up to 60 bytes long enclosed in quotes. You can string the parameters for several programs together or have individual INITPARM overrides for each.
Finally, I would recommend that any PLT program should have an ABEND error exit in it. An ABEND in PLTPI will bring down CICS with it. If the program ABENDs in PLTSD, CICS will wait and have to be cancelled. Even with programming restrictions PLT programs are useful points for building your own automation or customizing CICS operation.
ABOUT THE AUTHOR: Robert Crawford has been a CICS systems programmer off and on for 24 years. He is experienced in debugging and tuning applications and has written in COBOL, Assembler and C++ using VSAM, DLI and DB2.