Wait for an event to occur.
WAIT EVENT
>>-WAIT EVENT--ECADDR(ptr-value)--+------------+---------------><
'-NAME(name)-'
Condition: INVREQ
Note for dynamic transaction routing: Using this command
could create inter-transaction affinities that adversely affect the use of
dynamic transaction routing. See the Affinity for more information about transaction affinities.
Description
WAIT EVENT synchronizes a task with
the completion of an event initiated by the same task or by another task.
The event would normally be the posting, at the expiration time, of a timer-event
control area provided in response to a POST command, as described in POST. The WAIT EVENT command
provides a method of directly relinquishing control to some other task until
the event being waited on is completed.
CICS includes the addresses of all ECBs
passed by WAIT EVENT commands of current tasks in the ECBLIST passed by CICS
to the WAIT facility when it runs out of work.
A
given ECB may not be waited on by more than one task at the same time. If
this rule is not followed and the ECBLIST passed by CICS on the MVS WAIT contains
duplicate ECB addresses, MVS abends CICS.
Make
sure that asynchronous cross memory post (posting completion of an event in
an address space other than the user's own) is not used more frequently than
necessary. Large numbers of cross memory posts can consume excessive amounts
of system resources.
Options
- ECADDR(ptr-value)
- specifies
the address of the timer-event control area that must be posted before task
activity can be resumed.
- NAME(name)
- specifies
the symbolic name, 1–8 alphanumeric characters, that is returned in SUSPENDVALUE
or HVALUE, when a task issues WAIT EVENT and is the subject of an INQUIRE
TASK command or a CEMT INQ TASK.
Conditions
- 16 INVREQ
- RESP2
values:
- 2
- The ECB address is a null pointer, (X'00000000') or (X'FF000000').
- 3
- The specified event control area address is above the 16MB line for programs
executing in 24-bit mode.
- 4
- The event control area address is not aligned on a fullword boundary.
- 6
- The timer-event control area specified on a WAIT EVENT is in user-key
task-lifetime storage, and is inaccessible to another transaction. This condition
can only occur if the storage for the timer-event control area is obtained
other than by a POST command, and is for posting as an ECB by some other task
on completion of an event.
Note: CICS obtains storage for a timer-event control
area in response to a POST command (and which can be used in conjunction with
the WAIT EVENT command) from a shared subpool in user-key storage. This ensures
that timer-event control areas are in shared storage and, when referenced
by a subsequent WAIT EVENT command, do not fail with an INVREQ.
Default action: terminate the task abnormally.
Examples
The following example shows you how
to suspend the processing of a task until the specified event control area
is posted:
EXEC CICS WAIT EVENT ECADDR(PVALUE)