The EVENTS macro is a functional specialization of the WAIT macro with the ECBLIST parameter, with the advantages of notifying the program that events have completed and the order in which they completed.
The description of the EVENTS macro follows. The EVENTS macro is also described in z/OS MVS Programming: Assembler Services Reference ABE-HSP with the exception of the BRANCH=YES parameter.
The requirements for the caller are different for BRANCH=NO and BRANCH=YES.
If you specify BRANCH=NO, the requirements for the caller are:
Environmental factor | Requirement |
---|---|
Minimum authorization: | Problem state, with any PSW key |
Dispatchable unit mode: | Task |
Cross memory mode: | PASN=HASN=SASN |
AMODE: | 24- or 31-bit |
ASC mode: | Primary |
Interrupt status: | Enabled for I/O and external interrupts |
Locks: | No locks held |
Control parameters: | Must be in the primary address space |
If you specify BRANCH=YES, the requirements for the caller are:
Environmental factor | Requirement |
---|---|
Minimum authorization: | Supervisor state and key 0 |
Dispatchable unit mode: | Task |
Cross memory mode: | PASN=HASN=SASN |
AMODE: | 24- or 31-bit |
ASC mode: | Primary |
Interrupt status: | Enabled or disabled for I/O and external interrupts |
Locks: | Local lock must be held |
Control parameters: | Must be in the primary address space |
If you specify BRANCH=YES, you must include the CVT mapping macro.
None.
Before issuing the EVENTS macro, the caller does not have to place any information into any register unless using it in register notation for a particular parameter, or using it as a base register.
None.
The EVENTS macro is written as follows:
Syntax | Description |
---|---|
name | name: Symbol. Begin name in column 1. |
␢ | One or more blanks must precede EVENTS. |
EVENTS | |
␢ | One or more blanks must follow EVENTS. |
ENTRIES=n | n: Decimal digits 1-32767 |
ENTRIES=addr | addr: Register (2) - (12). |
ENTRIES=DEL,TABLE=tab addr | tab addr: Symbol, RX-type address, or register (2) - (12). |
TABLE=tab addr | Note: If the ENTRIES parameter is specified as indicated in the first two formats, no other parameters may be specified. |
,ECB=ecb addr | ecb addr: Symbol, RX-type address, or register (2) - (12). |
,LAST=last addr | last addr: Symbol, RX-type address, or register (2) - (12). |
Note: If LAST is specified, WAIT must also be specified. | |
,WAIT=YES | Note: Do not specify WAIT=YES when running in a disabled state. |
,WAIT=NO | |
,BRANCH=NO | Default: BRANCH=NO |
,BRANCH=YES | |
The parameters are explained below:
See z/OS MVS System Codes for explanations and responses for these codes.
None.
The following shows total processing through EVENTS.
EVENTS ENTRIES=1000
ST R1,TABADD
WRITE ECBA
LA R2,ECBA...
EVENTS TABLE=TABADD,ECB=(R2)
EVENTS TABLE=TABADD,WAIT=YES
LR R3,R1 PARMLIST ADDR
B LOOP2 GO TO PROCESS ECB
LOOP1 EVENTS TABLE=TABADD,WAIT=YES,LAST=(R3)
LR R3,R1 SAVE POINTER
LOOP2 EQU * PROCESS COMPLETED EVENTS
TM 0(R3),X'80' TEST FOR MORE EVENTS
BO LOOP1 IF NONE, GO WAIT
LA R3,4(,R3) GET NEXT ENTRY
B LOOP2 GO PROCESS NEXT ENTRY
EVENTS TABLE=TABADD,ENTRIES=DEL
TABADD DS F
EVENTS ENTRIES=10
ST 1,TABLE
NEXTREC GET TPDATA,KEY
ENQ (RESOURCE,ELEMENT,E,,SYSTEM)
READ DECBRW,KU,,'S',MF=E
LA 3,DECBRW
EVENTS TABLE=TABLE,ECB=(3),WAIT=YES
WRITE DECBRW,K,MF=E
LA 3,DECBRW
RETEST EVENTS TABLE=TABLE,ECB=(3),WAIT=NO
LTR 1,1
BNZ NEXTREC
B RETEST
TABLE DS F