07-26-2017 05:56 PM
How can i send a conditional email with different subject messages .Can you please help me out as im trying to execute my job in batch mode and trying to send emails based on success/unsuceesful of job ! i tried below but it is going to else statement even if the if statement is true.
FILENAME TEMP EMAIL TO=(
IF &count1.=0 then do;
subject="PBDV report Successfull for &run_date." ;
PUT 'PLEASE VIEW THE REPORT IN THE REPORTING PORTAL ' ;
today = put(date(),worddate18.);
PUT ' ' today;
subject="PBDV report not Successfull for &run_date.";
PUT "PBDV REPORT FAILED FOR &run_date." ;
Put ' This e-mail is an automated notification!';
PUT 'DO NOT REPLY TO THIS MESSAGE ';
Put ' Please contact:';
Put ' .person.@yahoo.com
Put ' if you have any questions or concerns.' ;
07-26-2017 06:18 PM
even IF statement is true , it is going to else staement and sending subject of the email "as job not successfull ".
07-26-2017 06:23 PM
If you're testing with the code you've posted then I don't see how this could happen.
Are you sure your macro variable contains a 0 when you believe the condition should be TRUE?
Use options symbolgen; to see in the Log to what your macro var resolves;
For test purposes populate the macro variable manually right before the data step
08-01-2017 10:01 AM
I have used Email directives from SAS and it worked, i just replaced current subject with the new one's.