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

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 982 views
  • 1 like
  • 3 in conversation