TPF User Exits
Making worldly changes without changing the world
by Alan Sadowsky
For those of us in the realm of Systems maintenance, there is the constant requirement of providing our customers with the processing functionality they require. While in most cases modifications to the Control Program are not difficult to provide, the desire to maintain the integrity of IBM's released source code is unquestionably the preferred goal. With the obvious question being; "How do I do this?" the obvious answer is User Exits.
User exits are not a new idea. Many of IBM's program products provide the user with the ability to make changes to the processing flow of an operating system through user exits. The benefit derived is the ability to satisfy the processing needs of the customer, while maintaining the "vanilla" status of the original product. With the option of user exits available, the task of applying IBM maintenance to the base product becomes considerably less painful.
USER EXITS IN A NUTSHELL
User exits are pre-defined locations within the TPF Control Program from which user-unique processing can be invoked. Examples of user-unique processing might be: test tools, system monitoring, accounting, etc. IBM provides a new Control Program CSECT 'CCUEXT' as a common repository for user written "exit routines" (via copy member 'CUSP') and the associated IBM provided user exit control mechanism. This relieves the user of the burden of having to update the TPF Control Program in many locations in order to implement and migrate user written code.
There are two types of exit points provided, called 'dynamic' and 'non-dynamic'. A dynamic exit point is one that can be activated or deactivated via an on-line macro (UXCMC) issued from an 'E-type' program. A non-dynamic exit point is activated (included in the system) via the assemble and link edit process for the Control Program.
When an exit point is encountered during Control Program processing, and that exit point is 'active', control is passed to the user exit routine associated with that exit point. The user exit routine will perform whatever processing is required, and will then return control to the mainline Control Program. It is the user's responsibility to provide an 'E-type' program for controlling the activation/deactivation of the dynamic exit Points via the UXCMC macro. To facilitate this a secondary action code of 'U' has been reserved by IBM for TPF users. The system message processor (SMP) package will pass control of all functional messages that begin with 'ZU...' to real-time segment UMEI. As released by IBM, UMEI provides no function, and the user must write the necessary code to perform the desired action (activate, deactivate, display status, etc.).
GETTING INTO THE BITS AND BYTES
To control the status of dynamic exit points, the UXCMC (User Exit Control) macro is issued from an E-type program. UXCMC has an associated parameter list specifying the status (active/inactive) of each potential exit point. Additionally, for each exit Point specified in the parameter list, the user can dynamically change the address of the user processing routine invoked by that exit Point (see Macro Manual- UXCMC).
During processing, if the exit point is not active, normal Control Program processing continues. If the exit point is active, then control is passed to the associated user exit routine. Non-dynamic exit points are activated whenever that exit point is encountered in the Control Program Processing. All exit Points are defined in the User Exits Control List (UCL). The UCL is used to establish the linkage to user processing for each exit point, and to record the status of dynamic exit points. The UCL is available for read-only purposes from E-type programs, and is addressable via CINFC tag CMMUCL. The UCL can only be modified via the UXCMC macro. The UXCMC macro is issued (from an E-type program) to change the status and user processing for dynamic exit points. For purposes of expediency, a low-core table is maintained and referenced to determine exit point status.
This table (CPMUXTBL) is only updated by the UXCMC macro, and reflects the status of the UCL. It should be noted that exit Point status is not carried across an IPL, however TPF's ZSTIM facility can be utilized to introduce an activate/deactivate message into the system during restart or cycle up/down processing.
RECAPPING THE CONCEPT
User exits provide a means by which user-unique functions tie. Step-By-Step Trace) can execute as an integral part, or extension, of the Control Program. By utilizing user exits, the potential need to provide your customer(s) with unique processing requirements is greatly simplified without compromising the "virtue" of the TPF Control Program. The job of implementing and migrating user written code is less burdensome, and the effort becomes a controlled process which is easier to manage across TPF releases.