Hello Everyone,
I would like to delay the start of the execution of a sas program by 10 minutes. I added this data _null_ step at the beginning of my sas code. But the program starts right away. How do I delay the execution of a program by a specified amont of time?
data _null_;
sletp = sleep(60*10);
run;
data aaa;
......... rest of the sas program.
I appreciate any input you may have!
Look for the CALL SLEEP function instead of trying to guess how long a loop takes.
Data _null_;
call sleep (600,1); /* 600 seconds*/
run;
If you're on a unix server, the default unit is millisecond, not second.
Thank you DBailey.
I changed the code to sleep(60*60*10) and it started right away too. Isn't that 10 minutes?
Thanks.
Look for the CALL SLEEP function instead of trying to guess how long a loop takes.
Data _null_;
call sleep (600,1); /* 600 seconds*/
run;
To repeat DBailey,
The default unit for enviornments other than windows is millisecond ( .001 ), so your server is most likely not a windows machine:
for 1 minute
rc=sleep(60,1)
http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a001418809.htm
or
call sleep(60,1)
http://support.sas.com/documentation/cdl/en/hostunx/61879/HTML/default/viewer.htm#a001462167.htm
Not if you're on a unix machine...
10 minutes * 60 seconds / minute * 1000 miliseconds / second = 600000
Thank you everyone for the helpful information!
I decided to use the Call Sleep function and it worked beautifully.
Thank you again for all your input
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.