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

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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