Suspends execution of the current SAS session until the specified
tasks finish executing
WAITFOR <_ANY | _ALL_> taskname1
<taskname2 ...tasknameX > <TIMEOUT=seconds>;
- specifies the name of the remotely submitted task(s) that
you wish to complete execution before resuming execution of SAS. You cannot
use wildcards to specify task names. Resumption of the SAS session depends
first on the value of the TIMEOUT= option, second on the execution state of
the specified task(s).
- _ANY_ | _ALL_
- suspends execution of the current SAS session until either
one or all of the specified remote tasks finishes execution. The default setting
is _ANY_, which means that as soon as one of the specified task(s) completes
execution, the WAITFOR statement will finish execution. Note again that resumption
of execution is primarily dependent on the TIMEOUT= option.
- specifies the maximum number of seconds that WAITFOR should
suspend the current SAS session, regardless of the execution state of any
or all specified tasks. The SAS session resumes execution at the end of the
TIMEOUT= period even if specified tasks are still executing. If you do not
specify the TIMEOUT= option and you do not specify any task names, WAITFOR
suspends execution of the SAS session indefinitely. If you specify tasks name(s)
and you do not specify a TIMEOUT= value, the SAS session resumes execution
when the specified tasks complete execution. Specifying TIMEOUT= without specifying
task names suspends SAS execution for the specified number of seconds.
Task names can be listed with the SYSTASK LIST statement.
These task names are assigned on other hosts and are supplied to the OS/390
SAS session via RSUBMIT commands or statements in SAS/CONNECT software.
The SYSRC macro variable contains the return code for the WAITFOR statement.
If a WAITFOR statement cannot execute successfully, the SYSRC macro variable
will contain a non-zero value. For example, the WAITFOR statement may contain
syntax errors. If the number of seconds specified with the TIMEOUT option
elapses, then the WAITFOR statement finishes executing and the SYSRC macro
variable is set to a non-zero value if:
- you specify a single task that does not finish executing.
- you specify more than one task and the _ANY_
option (which is
the default setting), but none of the tasks finishes executing.
- you specify more than one task and the _ALL_ option, and any one
of the tasks does not finish
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.