You can use the CIRB macro to initialize an IRB for an asynchronous
exit. You can reuse an initialized IRB by omitting STAB=DYN on the
CIRB macro. Thus, you need to invoke the CIRB macro only once for
two or more invocations of an exit routine.
Detailed information
about using the CIRB macro appears in z/OS MVS Programming: Authorized Assembler Services Reference ALE-DYN.
When the system returns control to the caller, it returns the IRB
address in
register 1. The IQE, if requested
via the WKAREA parameter of the CIRB macro, occupies storage contiguous
to the IRB and is pointed to by the RBNEXAV field in the IRB. The
problem program work area, if requested, is pointed to by the RBPPSAV1
word in the IRB. The data area configuration is shown in
Figure 1.
Figure 1. Asynchronous
Exit Data Area Configuration
The caller must initialize
the IQE. The fields to be initialized
are:
- IQEPARAM -- optional address of the parameter list to
be passed
to the exit routine.
- IQEIRB
-- address of the IRB as returned in register 1 by the
CIRB macro.
- IQETCB --
address of the TCB for the task under which the user's
exit routine is to run. If this is not the task that issued CIRB
then, if you specified the STAB=DYN option of the CIRB macro to ask
the system to free the IRB and IQE, you need to have specified the
BRANCH=YES option of the CIRB macro, having placed the address of
the IQETCB task into register 4 before issuing CIRB, in order for
the freeing to succeed.
The fields in the IRB initialized by the CIRB macro are:
The
options you choose to specify on the CIRB macro affect the
characteristics of the asynchronous exit routine. Consider the following
when coding the CIRB macro:
- The exit routine runs enabled
in the key and state requested by
the CIRB macro.
- Upon entry, the exit routine runs with an
empty dispatchable unit
access list (DU-AL). To establish addressability to a data space
created by the mainline routine, the exit routine can use the ALESERV
macro with the ADD parameter, and specify the STOKEN of the data space.
- Register contents upon entry to the exit routine are:
- Register
- Contents
- 0
- IQE address
- 1
- Parameter list
address (IQEPARAM)
- 2-12
- Do not
contain any information for use by the routine.
- 13
- Problem program register save area address, if any
- 14
- Return address
- 15
- Entry point address
- When the asynchronous exit completes:
- If your
program provided the IQE, you can update the IQE if you
hold the local lock and have verified that the IRB has received control.