Chapter 2. Task-related user exit programs
This chapter describes a special kind of user exit called a task-related user exit
(TRUE). The chapter is divided into the following sections:
1. “Introduction to the task-related user exit mechanism (the adapter)”
2. “The stub program” on page 269
3. “Writing a task-related user exit program” on page 271
4. “Administering the adapter” on page 302.
Introduction to the task-related user exit mechanism (the adapter)
A task-related user exit allows you to write your own program to access a resource,
such as a database, that would not otherwise be available to your CICS system.
Such a resource is known as a non-CICS resource. The exit is said to be
task-related because it becomes part of the task that invoked it and because, unlike
a global user exit, it is not associated with an exit point. You do not have to use any
of the task-related user exits, but you can use them to extend and customize the
function of your CICS system according to your own requirements.
The most common use of a task-related user exit is to communicate with a
resource manager external to CICS; for example, a file or database manager. The
CICS interface modules that handle the communication between the task-related
user exit and the resource manager are usually referred to as the resource
manager interface (RMI) or the task-related user exit interface.
The task-related user exit mechanism is known as an adapter because it provides
the connection between an application program that needs to access a non-CICS
resource and the manager of that resource. Figure 4 on page 268 illustrates the
adapter concept.
The adapter is made up of three or more locally-written programs. These are a
“stub” program, a task-related user exit program, and one or more administration
routines or programs.
The stub program intercepts a request (for example, to access data held on an
external database manager) issued by the calling application program. The stub can
be used to resolve a locally-defined high-level language command into a
task-related user exit macro call, DFHRMCAL, which then causes CICS to pass
control to the task-related user exit program.
The task-related user exit program translates commands for accessing a
non-CICS resource into a form acceptable to the resource manager. The program
must be written in assembler language, and can reside above or below the 16MB
line. For more guidance information about addressing and residency modes, refer to
“Addressing-mode implications” on page 289. The program must not alter the
contents of any access registers. It is executed in response to a specific application
program request, for example, to read data from an external database. In this
instance, it may be passed application data, such as a search argument for a
required record. Responses from the resource manager are passed back to the
calling program by the task-related user exit program.
© Copyright IBM Corp. 1977, 2011 267