Using the SCHEDIRB macro to initialize and schedule an IRB

The SCHEDIRB macro is the recommended interface for initializing an IRB for an asynchronous exit and scheduling the exit routine to run. Use the SCHEDIRB macro to initialize and schedule an exit routine, rather than the CIRB and SCHEDXIT macros.

When you use the SCHEDIRB macro both to initialize the IRB and to schedule the asynchronous exit to run, you can control when it runs by scheduling the IRB for the exit in the following ways:
  • Schedule the IRB to run under any task in the current address space by specifying a TCB address on the TCBPTR parameter.
  • Schedule the IRB to run prior to any RB under the current task in the current address space by specifying an RB address on the RBPTR parameter. This type of IRB is called a directed IRB.

The best way to use directed IRBs is to make sure that the calling program is running under an IRB. If the system has suppressed asynchronous exits or the current task is in process-must-complete mode when SCHEDIRB is invoked, the calling program will get a non-zero return code unless the calling program is running under an IRB. You can make sure the calling program is running under an IRB by first invoking the SCHEDIRB macro with the TCBPTR option or by invoking the STIMER macro.

Detailed information about coding the SCHEDIRB macro appears in z/OS MVS Programming: Authorized Assembler Services Reference LLA-SDU.

The options you choose to specify on the SCHEDIRB macro affect the characteristics of the asynchronous exit routine. Consider the following when coding the SCHEDIRB macro:
  • The exit routine runs in the mode specified on the MODE parameter.
  • The exit routine runs in the key specified on the KEY parameter.
  • If you specify the TCBPTR parameter, you can also request a save area using the SVAREA parameter.
  • SCHEDIRB passes a parameter list to the exit routine if you specify it on the PARAMPTR parameter.
  • Register contents upon entry to the exit routine are:
    Register
    Contents
    0
    Does not contain any information for use by the exit routine
    1
    Parameter list address (PARAMPTR), if any
    2-12
    Do not contain any information for use by the exit routine
    13
    Problem program register save area address, if SVAREA=YES was specified.
    14
    Return address
    15
    Entry point address