BookmarkSubscribeRSS Feed
ren2010
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.
7 REPLIES 7
sbb
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.
ren2010
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.
ren2010
Obsidian | Level 7
Thanks Sandhya.
ppsas
Calcite | Level 5
Hi Sandhya,

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

Thanks in advance.
DUNE
LAP
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;
%LET step= &SYSERRORTEXT;

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
kaji
Fluorite | Level 6

Hi,

 

I found a pretty cool add-in to Base SAS on www.tatesoft.com 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!

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!

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 7 replies
  • 3344 views
  • 0 likes
  • 6 in conversation