LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (February 2002, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 20 Feb 2002 15:25:24 -0500
Reply-To:     "Goldman, Brad (AT-Atlanta)" <Brad.Goldman@AUTOTRADER.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "Goldman, Brad (AT-Atlanta)" <Brad.Goldman@AUTOTRADER.COM>
Subject:      Re: Sending email alert when my batch job blows
Content-Type: text/plain; charset="iso-8859-1"

> <jhiller@EOSBIOTECH.COM> wrote: > >I'd like to send myself an email if a batch job that I run > each night fails > >due to errors. (I'm Running SAS v8.2 under WinNT.) The > problem is that the > >data _null_ step to send the email won't execute because SAS > enters error- > >checking mode and sets obs=0 after it encounters the first > error. Sample > >code below. Does anybody know a work-around?

Jordan,

I have a similar kind of situation, maybe this code will help. The key is to set a var to "bad". If a step executes successfully, it changes it to "good". So when you get to the end, you check if it is good or bad, and then you can conditionally do something. The sending of the email (or whatever) is then separated out from the error checking by putting it in a different step.

-Brad Goldman

------------------------------------------ data _null_; call symput('status','B'); run;

data _null_; infile 'http://10.102.8.75:80/reports/default.asp' URL; call symput('status','G'); run;

%macro choose; %if &status.=B %then %do; data _null_; <send email here> run; %end; %if &status.=G %then %do; <proceed> %end; run; %mend; *choose; %choose;


Back to: Top of message | Previous page | Main SAS-L page