BookmarkSubscribeRSS Feed
mmagnuson
Quartz | Level 8

Hi,

 

Currently there is a schedule that automatically runs SAS programs at 12:00 am every morning. I've included the following code to delay it until 3 pm but it has not worked.

 

data _null_;
start=DHMS(DATE(), 15, 00, 00);
wait_sec=start-datetime();
zzz=sleep(wait_sec,1);
run;
 
Is there something wrong with the code above?
 
Thanks!
2 REPLIES 2
SASKiwi
PROC Star

I don't see anything wrong with the logic, but how it works in practice might be different. What does 'has not worked' mean? It would be better to create a new 3pm schedule.

TomKari
Onyx | Level 15

If you submit it after 3PM (as I just did!) your interval will be negative. Here's a fix to move it to the NEXT 3PM.

 

Tom

 

data _null_;
	starttime=hms(23, 00, 00);
	if time() < starttime start=DHMS(DATE(), 0, 0, starttime);
	else start=DHMS(DATE()+1, 0, 0, starttime);
	wait_sec=start-datetime();
	zzz=sleep(wait_sec,1);
run;

SAS Innovate 2025: Call for Content

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!

Submit your idea!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 2 replies
  • 665 views
  • 1 like
  • 3 in conversation