Help using Base SAS procedures

How to check logs for errors and send email thru sas code

Reply
Contributor
Posts: 74

How to check logs for errors and send email thru sas code

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.
Super Contributor
Super Contributor
Posts: 3,174

Re: How to check logs for errors and send email thru sas code

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.
Contributor
Posts: 74

Re: How to check logs for errors and send email thru sas code

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.
Contributor
Posts: 57

Re: How to check logs for errors and send email thru sas code

Hi,

This link is very useful

http://www.tau.ac.il/cc/pages/docs/sas8/cms/z1271256.htm

Sandhya.
Contributor
Posts: 74

Re: How to check logs for errors and send email thru sas code

Thanks Sandhya.
N/A
Posts: 1

Re: How to check logs for errors and send email thru sas code

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
Frequent Contributor
Frequent Contributor
Posts: 76

Re: How to check logs for errors and send email thru sas code

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
Occasional Contributor
Posts: 13

Re: How to check logs for errors and send email thru sas code

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!

Ask a Question
Discussion stats
  • 7 replies
  • 443 views
  • 0 likes
  • 6 in conversation