BookmarkSubscribeRSS Feed
Hari2
Quartz | Level 8

Hi All,

 

1. we have option to schedule SAS jobs automatically in internal sas tool. 

2. Now we need to pick the latest file from path where logs get saved and then, 

3. we will need to check for errors and send notification email with or without errors. 

 

 

Please suggest , steps to achieve above. thanks. 

7 REPLIES 7
Patrick
Opal | Level 21

"...schedule SAS jobs automatically internal sas tool"

Can you please provide a bit more detail which scheduler you're using and how you're scheduling?

Hari2
Quartz | Level 8

Hi Patrik,

 

Thanks for responding. it's not any external scheduler we are using rather it's a platform which allows to connect to sas and execute all sas tasks. We can run, schedule all sas programs & jobs within it. 

 

- SAS logs are routed to a separate folder. We want to pick latest sas log file and then check the details inside the log. 
- If we find ERROR: , then mail should send out automatically. And if no ERROR:, even then we will send mail saying Job executed without any issues. 

 

Ex: LSAF - Life science Analytical Framework  

Patrick
Opal | Level 21

Is that SAS9 or Viya?

 

Reason I'm asking: Before proposing to scan SAS logs I'd like to understand if you're using a scheduling mechanism that could fork to some actions/execute logic based on the return code of the SAS program the scheduler executes.

Patrick
Opal | Level 21

@Hari2 wrote:

It's sas. 


There is SAS9.n and SAS Viya. SAS Viya is the most recent version and the future of SAS but not all SAS9.n functionality and solutions exist already under SAS Viya which is why these two versions currently need to co-exist.

 

If you can't provide more detail about your environment and how exactly you're scheduling jobs then there are just too many possibilities to propose something concrete.

 

With many schedulers that trigger SAS scripts run in batch there are also configuration options in the scheduler to send out an email in case the triggered batch job ends with an error condition. If that's possible then it would certainly be preferable over scanning SAS log files for errors.

 

SASKiwi
PROC Star

Most scheduling tools contain the functionality to auto email when the job being run returns a nonzero job return code. For SAS this means any job containing warnings or errors. If you are using SAS Management Console's Schedule Manager you can set this up in the job properties. This is a lot easier than scanning SAS logs for error messages.

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 7 replies
  • 1165 views
  • 2 likes
  • 3 in conversation