Scheduling an SRB using SCHEDULE

To schedule an SRB using SCHEDULE, follow these procedures:
  1. Allocate storage for the SRB from fixed, commonly addressable storage, with any storage key (0-7).
  2. Determine whether or not the SRB routine requires either the same cross-memory environment as the scheduling program or a copy of the scheduling program's DU-AL. If the SRB routine needs either of these, specify MODE=FULLXM on the SCHEDULE macro.
    If the SRB routine does not need the same cross-memory environment as the scheduling program or a copy of the scheduling program's DU-AL:
    • Specify MODE=NONXM on the SCHEDULE macro.
    • Specify the address space in which the SRB routine is to run.
  3. Assign the priority of the SRB

    Through the SCHEDULE macro, a program schedules either a global SRB (through SCOPE=GLOBAL) or a local SRB (through SCOPE=LOCAL), depending on the priority at which you want the system to dispatch the SRB routine. The system gives a global SRB a priority that is above that of any task in any address space. The system gives a local SRB a priority equal to that of the address space in which the SRB routine will run, but higher than that of any task within that address space.

    The global SRBs that user programs dispatch compete with the global SRBs that the system dispatches. Therefore, IBM® recommends that you specify SCOPE=LOCAL (the default).

  4. Initialize fields in the SRB that identify:
    • The SRB routine
    • A parameter list, if required
    • Additional information for recovery and control

    Initializing the SRB provides additional information on obtaining and initializing the SRB.

  5. Issue the SCHEDULE macro with the appropriate parameters.