BookmarkSubscribeRSS Feed
meckarthik
Quartz | Level 8

Hi There,

I've created some codes which run automatically when run command is pressed, but i need to be run only when certain conditions are met, otherwise should stop and close the SAS program (if possible).

eg. after 4 pm on Friday

 

Any help 

 

2 REPLIES 2
andreas_lds
Jade | Level 19

@meckarthik wrote:

Hi There,

I've created some codes which run automatically when run command is pressed, but i need to be run only when certain conditions are met, otherwise should stop and close the SAS program (if possible).

eg. after 4 pm on Friday

 

Any help 

 


Such tasks are handled by schedulers. Depending on the code you have, it could be possible to add some checks and terminate the sas process, but i can't recommend re-inventing the wheel.

PaigeMiller
Diamond | Level 26

Here is a possibility:

 

data _null_;
    if weekday(today())=6 and timepart(datetime())>'16:00't then endsas;
run;

 

--
Paige Miller

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 975 views
  • 1 like
  • 3 in conversation