The WAITFOR statement
causes the client session to wait for the completion of one or more
tasks that are in progress in the server session as specified by the
options _ANY_ or _ALL_. WAITFOR synchronizes dependent tasks. You
can use WAITFOR only for asynchronously executing tasks. If you use
WAITFOR and there are no asynchronous tasks executing, the WAITFOR
statement does not enforce a wait condition. Instead, execution continues
in the client session.
The name of the task
corresponds with the
server-ID.
The WAITFOR statement
can wait for the completion of one or more tasks. If more than one
task is specified and neither _ANY_ nor _ALL_ is specified, _ANY_
is implied. The client session will wait for any of the listed tasks
to complete before resuming control. This is not an error condition.
If more than one task
is specified, and the _ANY_ option is specified, the client session
waits for the completion of any of the specified tasks (a logical
OR of the completion task states). If the _ALL_ option is specified,
the client session waits for the completion of all the specified tasks
(a logical AND of the completion task states). The WAITFOR statement
does not support complex logical statements, such as A OR (B AND C).
Invalid tasks that are
specified in the WAITFOR statement are ignored but are identified
in notes in the SAS log.