Use the WAKEUP function
to specify the amount of time a DATA step continues to execute. The
return value is the number of seconds slept.
The
until-when argument
can be a SAS datetime value, a SAS time value, or a numeric constant,
as explained in the following list:
-
If until-when is
a datetime value, the WAKEUP function sleeps until the specified date
and time. If the specified date and time have already passed, the
WAKEUP function does not sleep, and the return value is 0.
-
If until-when is
a time value, the WAKEUP function sleeps until the specified time.
If the specified time has already passed in that 24-hour period,
the WAKEUP function sleeps until the specified time occurs again.
-
If the value of until-when is
a numeric constant, the WAKEUP function sleeps for that many seconds
before or after the next occurring midnight. If the value of until-when is
a positive numeric constant, the WAKEUP function sleeps for until-when seconds
past midnight. If the value of until-when is
a negative numeric constant, the WAKEUP function sleeps until until-when seconds
before midnight.
Negative values for
the until-when argument are
allowed, but missing values are not. The maximum sleep period for
the WAKEUP function is approximately 46 days.
When you submit a program
that calls the WAKEUP function, the SLEEP window
appears, telling you when SAS is going to wake up. You can inhibit
the SLEEP window by starting SAS with the NOSLEEPWINDOW system option. Your SAS session remains
inactive until the waiting period is over. If you want
to cancel the call to the WAKEUP function, use the Ctrl + BREAK attention sequence.
You should use a null
DATA step to call the WAKEUP function; follow this DATA step with
the rest of the SAS program. Using the WAKEUP function in this manner
enables you to use the CTRL+BREAK attention sequence to interrupt
the waiting period and continue with the execution of the rest of
your SAS program.