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.
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.
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;
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and save with the early bird rate—just $795!
Check out this tutorial series to learn how to build your own steps in SAS Studio.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.