z/OS DFSMS Macro Instructions for Data Sets
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


WAIT—Wait for one or more events (BDAM, BISAM, BPAM, and BSAM)

z/OS DFSMS Macro Instructions for Data Sets
SC23-6852-02

The WAIT macro informs the control program that performance of the active task cannot continue until one or more specific events, each represented by a different ECB (event control block), have occurred. The ECBs represent completion of I/O processing associated with a READ or WRITE macro. ECBs are located at the beginning of access method DECBs (data event control blocks), so that the DECB name provided in READ and WRITE macros is also used for WAIT. (A description of the ECB is found in Status information following an input/output operation.For information on when to use the WAIT macro, see z/OS DFSMS Using Data Sets.)

The control program takes the following action:
  • For each event that has already occurred (each ECB is already posted), the count of the number of events is decreased by 1.
  • If number of events is 0 when the last event control block is checked, control is returned to the instruction following the WAIT macro.
  • If number of events is not 0 when the last ECB is checked, control is not returned to the issuing program until sufficient ECBs are posted to bring the number to 0. Control is then returned to the instruction following the WAIT macro.
  • The events are posted complete by the system when all I/O is completed, temporary errors corrected, and length checking performed. The DECB is not checked for errors or exceptional conditions, nor are end-of-volume procedures initiated. Your program must perform these operations.

    If you coded MULTACC on the DCBE macro with a nonzero value and you issue a WAIT macro for a BSAM or BPAM DECB, then issue a TRUNC macro before the WAIT and after the previous READ or WRITE to the DECB.

Processing PDSEs and Compressed Format Data Sets

If the PDSE member is open for update or a compressed format data set is open for output, and in a storage class with "Guaranteed Synchronous Write" specified, issue a CHECK macro following a WRITE macro to guarantee that the data is synchronized to DASD. Otherwise, synchronization is not guaranteed until CLOSE, or the STOW macro or the SYNCDEV macro is issued. Synchronization occurs at CLOSE if BSAM or QSAM are used to process the PDSE members or compressed format data set. Specifying "Guaranteed Synchronous Write" in the storage class produces the same result as issuing the SYNCDEV macro.

The format of the WAIT macro is:

number of events
specifies a decimal integer from 0 to 255. Zero is an effective NOP instruction; 1 is assumed if the parameter is omitted. The number of events must not exceed the number of event control blocks. You can also use register notation (2-12).
ECB=addr
specifies the address of the event control block (or DECB) representing the single event that must occur before processing can continue. The parameter is valid only if the number of events is specified as 1 or is omitted.
addr
specify RX type or use register notation (1-12).
ECBLIST=addr
specifies the address of a virtual storage area containing one or more consecutive fullwords on a fullword boundary. Each fullword contains the address of an event control block (or DECB). The high-order bit in the last word (address) must be set to 1 to indicate the end of the list. The number of event control blocks must be equal to or greater than the specified number of events.
LONG=[YES|NO]
specifies whether the task is entering a long wait or a regular wait. Normally, I/O events should not be considered 'long' unless it is anticipated that operator intervention is required.

Caution: A job step with all its tasks in a WAIT condition terminates on expiration of the time limits that apply to it.

Access method ECBs are maintained entirely by the access methods and supporting control program facilities. You can inspect access method ECBs, but should never modify them.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014