The stub program

The stub program shields application programmers from the mechanics of non-CICS resource managers. It is written in assembler language. After assembly, the stub is link-edited to each application program that wants to use it.

Figure 1. The stub concept
The picture shows an application program joined to a stub program, and a separate task-related user exit program. An arrow points from a CALL statname command in the application program to an ENTRY statname entry point in the stub. Another arrow points from a DFHRMCAL TO=ename macro call in the stub to an ename entry point in the task-related user exit program.
statname
A label that can be referenced externally. Statname must conform to the requirements of an assembler language ENTRY statement, and typically resolves a V-type address constant, or the target of a high-level language CALL. A single stub can contain several such labels.
ename
The entry name (specified on the EXEC CICS ENABLE command) of the task-related user exit program that you want to handle resource manager requests.
You can define high-level language commands for your programmers to use when they want to access a non-CICS resource. You must use a translator to convert a locally defined high-level language command into a conventional CALL to the required entry point of the stub program. Alternatively, the application program can issue a CALL naming the stub entry point, as shown in Figure 1. For example, to read a record from a non-CICS resource, an application program can use the following COBOL statement:
CALL 'XYZ' USING PARM1 PARM2...
XYZ is an entry point (the statname) in your stub program. The stub converts the command into a macro call (DFHRMCAL) to the task-related user exit program, specified in the TO= operand. Return from the task-related user exit program is to the calling application program, not to the stub program.

The application can use a parameter to determine whether the resource manager was called. For example, if the application sets a parameter to zero and the resource manager sets it to nonzero, the parameter value on return indicates whether the resource manager was invoked.

Notes:
  • You can use only the TO, RTNABND, and SUPPEDF operands of the DFHRMCAL macro. Any other operands are for CICS® internal use only.
  • The DFHRMCAL macro cannot be invoked by an AMODE(64) application program.