| Date: | Tue, 19 Dec 2006 14:14:47 +0530 |
| Reply-To: | mohit.b.bhatia@AEXP.COM |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | Mohit Bhatia <mohit.b.bhatia@AEXP.COM> |
| Subject: | Re: customised endsas; |
|
| Content-Type: | text/plain; charset=us-ascii |
Hi,
Actually I have used this email code earlier. The only difference this
time is that I am using it under an IF-Then code. So basically it sends an
email only on a particular condition being true.
Its not working. Is something wrong with my IF-THEN statement.??
"David L Cassell" <davidlcassell@MSN.COM>
Sent by: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
12/19/2006 11:12 AM
Please respond to "David L Cassell"
To: ,
cc:
Subject: Re: customised endsas;
pchoate@DDS.CA.GOV replied:
>
>-----Original Message-----
>From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of
Mohit
>Bhatia
>Sent: Monday, December 18, 2006 7:54 AM
>To: SAS-L@LISTSERV.UGA.EDU
>Subject: Re: customised endsas;
>
>Hi,
>
>I am using the following code. But it still doesnt send an email.
>
>%macro checkerrors;
>%if (&prod_class_invalid='Y' or &prod_type_invalid='Y'or
>&source_invalid='Y' or &contact_invalid='Y' or &presac_invalid='N' or
>&acct12_missing ='Y' or &sac_date_missing='Y') %then %do;
>
>
>
>data _null_;
>filename mymail email 'mohit.b.bhatia@aexp.com'
> subject="A Critical Error occured";
> file mymail;
> put 'Hi,';
> put 'Critical Error.' ;
> put 'This is an automatically generated report.Please do not reply';
>
>run;
>
>%end;
>
>%mend checkerrors;
>
>%checkerrors;
>
>
>
>
>"Eivind Heioghaa" <x47x@CODANMARINE.NO>
>Sent by: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
>12/18/2006 05:07 PM
>Please respond to "Eivind Heioghaa"
>
>
> To: SAS-L@LISTSERV.UGA.EDU
> cc:
> Subject: Re: customised endsas;
>
>
>Hi Mohit,
>
>How about something like this:
>
>
>/*1. Find if you have any observations with errors*/
>data yourErrorDataSet; set dataset;
> if amount < 0;
>run;
>
>/*2. Check your new dataset and perform action if you have any
>observations
>in it*/
>%macro checkForErrors;
> %nobs( <yourErrorDataSet>);
> %put &nobs;
> %if &nobs > 0 %then %do;
> data _null_;
> filename message email "<yourEmailAddress>"
> subject="An Error Occurred";
> file message;
> put "An error occurred .......";
> run;
> %end;
>%mend checkForErrors;
>
>Mohit - MACRO code does not use quoting the way the datastep does - try
>this instead:
>
>%macro checkerrors;
>%if (&prod_class_invalid=Y or &prod_type_invalid=Y or
>&source_invalid=Y or &contact_invalid=Y or &presac_invalid=N or
>&acct12_missing =Y or &sac_date_missing=Y) %then %do;
>
>filename mymail email 'mohit.b.bhatia@aexp.com'
> subject="A Critical Error occured";
>
>data _null_;
> file mymail;
> put 'Hi,';
> put 'Critical Error.' ;
> put 'This is an automatically generated report. Please do not reply';
>run;
>%end;
>
>%mend checkerrors;
>
>%checkerrors
>
>hth
>
>Paul Choate
>DDS Data Extraction
>(916) 654-2160
In addition to Paul's excellent adivce, let me suggest that you
check over your SAS email setting very carefully. You have to
set up the system so that it uses your company mail protocols.
That's typicalyl SMTP, but it may not be.
Do you have MS Outlook? Then SAS may be set up correctly.
Unless your IT people have locked down user privileges for MS
Outlook to prevent automated mailing. In that case, you may
need special permissions for the user ID that SAS runs under
and submites email under (which is likely to be something other
than your username).
If you have something else, you need to check your settings
and your SAS options. In particular, if you are using Lotus
Notes, you need to fix the settings, since you will be using
VIM instead of SMTP to transmit that email.
HTH,
David
--
David L. Cassell
mathematical statistician
Design Pathways
3115 NW Norwood Pl.
Corvallis OR 97330
_________________________________________________________________
Get FREE Web site and company branded e-mail from Microsoft Office Live
http://clk.atdmt.com/MRT/go/mcrssaub0050001411mrt/direct/01/
American Express made the following
annotations on 12/19/06, 01:45:04
------------------------------------------------------------------------------
******************************************************************************
"This message and any attachments are solely for the intended recipient and may contain confidential or privileged information. If you are not the intended recipient, any disclosure, copying, use, or distribution of the information included in this message and any attachments is prohibited. If you have received this communication in error, please notify us by reply e-mail and immediately and permanently delete this message and any attachments. Thank you."
American Express a ajouté le commentaire suivant le 12/19/06, 01:45:04
Ce courrier et toute pièce jointe qu'il contient sont réservés au seul destinataire indiqué et peuvent renfermer des renseignements confidentiels et privilégiés. Si vous n'êtes pas le destinataire prévu, toute divulgation, duplication, utilisation ou distribution du courrier ou de toute pièce jointe est interdite. Si vous avez reçu cette communication par erreur, veuillez nous en aviser par courrier et détruire immédiatement le courrier et les pièces jointes. Merci.
******************************************************************************
=============================================================================
|