BookmarkSubscribeRSS Feed
Obsidian | Level 7
Hi All,

Just wondering is there any SAS code available to check SAS logs for errors and if send email if the job was failure or success to the person who ran the job?

I am trying to automate my process,if you all can help me,that would be great.

Thanks in advance.
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
What OS platform and verify that you are running SAS on your local machine (or otherwise). Also the SAS version would be helpful.

You can use FILENAME EMAIL engine to send a SAS notification, based on the previous SAS processing success or failure.

Scott Barry
SBBWorks, Inc.
Obsidian | Level 7
Thanks SBB,
I am using SAS on Windows server,do you have any suggestions/reference document, how to check the errors in SAS log using SAS code.
Obsidian | Level 7
Thanks Sandhya.
Calcite | Level 5
Hi Sandhya,

Can you please give me the access for the below link,or can you please send me the check logs for errors and send email thru sas code.

Thanks in advance.
Quartz | Level 8 LAP
Quartz | Level 8
I have several jobs that are scheduled to run each night.

I capture errors based on the &syserr macro variable and %syserrortext (new in SAS 9.2) at relevents spots in my code and assigning to a new macro variable. At the end of my job, I can check the value of each of these error variables and send a status report (via email to myself or project leads).

For instance (simple example)

%let step1err = -1; * Real errors are 0 - ....; -1 indicated that step not run;
%let step1msg = ;

step goes here...

%let STEP1err = &SYSERR;

At the end of the job I collect all my steperrs and create a report that shows how each step completed.

This is very generalized.. you will have to adapt method to your own circumstances. Hope this gives you a startting point
Fluorite | Level 6



I found a pretty cool add-in to Base SAS on that may be very usefull to you. The tool called Log Analyser is integrated into Base SAS and can produce Log summary report in a second. You may also analyse log in details if you wish. Really great tool!



Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Get the $99 certification deal.jpg



Back in the Classroom!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 7 replies
  • 6 in conversation