Chapter Contents |
Previous |
Next |
SLEEP |
Windows specifics: | all |
Syntax | |
Details | |
Example |
Syntax |
SLEEP(num-seconds) |
Details |
The SLEEP function suspends execution of a DATA step for a specified number of seconds.
The return value of the num-seconds argument is the number of seconds slept. The maximum sleep period for the SLEEP function is approximately 46 days.
When you submit a program that calls the SLEEP function, a pop-up window appears telling you how long the SAS System is going to sleep. Your SAS session remains inactive until the sleep period is over. If you want to cancel the call to the SLEEP function, use the CTRL+BREAK attention sequence.
You should use a null DATA step to call the SLEEP function; follow this DATA step with the rest of the SAS program. Using the SLEEP function in this manner enables you to use the CTRL+BREAK attention sequence to interrupt the SLEEP function and to continue with the execution of the rest of your SAS program.
Example |
This example of the SLEEP function tells the SAS System to delay the execution of the program for 12 hours and 15 minutes:
data _null_; /* argument to sleep must be expressed in seconds */ slept= call sleep((60*60*12)+(60*15)); run; data monthly; /*... more data lines */ run;
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.