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


CFC_SAS_Communities_400x225.jpg

Call for content now open!

It's your turn to help shape SAS Innovate 2027. Share your expertise and inspire the SAS community.

Submit your proposal →

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 6 replies
  • 12278 views
  • 3 likes
  • 4 in conversation