BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
KevinC_
Fluorite | Level 6

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!

Smiley Happy

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

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;

View solution in original post

6 REPLIES 6
DBailey
Lapis Lazuli | Level 10

If you're on a unix server, the default unit is millisecond, not second.

KevinC_
Fluorite | Level 6

Thank you DBailey.

I changed the code to sleep(60*60*10) and it started right away too.  Isn't that 10 minutes?

Thanks.

ballardw
Super User

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;

FriedEgg
SAS Employee

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)

SLEEP Function

http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a001418809.htm

or

call sleep(60,1)

CALL SLEEP Routine: UNIX

http://support.sas.com/documentation/cdl/en/hostunx/61879/HTML/default/viewer.htm#a001462167.htm

DBailey
Lapis Lazuli | Level 10

Not if you're on a unix machine...

10 minutes * 60 seconds / minute * 1000 miliseconds / second = 600000

KevinC_
Fluorite | Level 6

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 Smiley Happy


sas-innovate-2024.png

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.

 

Register now!

What is Bayesian Analysis?

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 6 replies
  • 7578 views
  • 2 likes
  • 4 in conversation