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
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.