data step execution aborted while sending the emails from sas

Reply
Contributor
Posts: 36

data step execution aborted while sending the emails from sas

Hi,

My mails data set looks as follows

1abc123@some.com
2def@some.com
3ghi@some.com
4jkl@some.com
5abc123@some.com
6def@some.com
7def@some.com

consider abc123@some.com is a wrong email

As of now my code looks as follows;;;

STEP=1: Sorting the data set.

--------------------------------------------------------------------------------------------------------------------

PROC SORT DATA=mails;

BY mail_id;

RUN;

-----------------------------------------------------------------------------------------------------------------------------------

STEP=2 : Sending mails for every three hundred users after holding the triggering mails process for 2 mnts..

---------------------------------------------------------------------------------------------------------------------------------------


%macro send_email;

filename hm_mail email lrecl=32000 type='text/html';


data _null_;   
set mails END=EOF;
by mail_id;
file hm_mail;


retain numofusers 0;

if first.mail_id then do; 

     numofusers=numofusers+1;
  If mod(numofusers,300) = 0 then Timer=Sleep(120,1);

  put '!EM_TO!' mail_id;
  put '!EM_SUBJECT!' 'Test Plans have been created.';
  put 'The following test plans have been created with you as a tester.';
  put '<br>';
end;

id_link = '<a href="' ||left(strip(id)) || '">' || left(strip(id)) || '</a>' ;
put '<br>';
put id_link;
put '<br>';

if last.mail_id then do;
  put '<br>';
  put 'This is a system-generated message. Do not reply to this e-mail.';
  put '!EM_SEND!';
  put '!EM_NEWMSG!';
end;

if EOF then put '!EM_ABORT!';


run;

%mend send_email;
%send_email;

Here I am getting an error message as below when %send_email is excecuted

***********Below is the error message in email logs******************************************************

WARNING: Email: 550 5.1.1 <abc123@some.com Recipient address rejected: User unknown

WARNING: Bad email address: abc123@some.com

ERROR: No email addresses specified.

FATAL: Unrecoverable I/O error detected in the execution of the DATA step program.  Aborted during the EXECUTION phase.

**************************************************************************************************************

After this its not sending emails to the remaining users..

Could you please suggest me how to add an exception to handle this error at the time of exection..

Many thanks in advance..

Trusted Advisor
Posts: 3,214

Re: data step execution aborted while sending the emails from sas

Posted in reply to K_HARI__PRASAD

posted twice some problem same issue: https://communities.sas.com/message/243588#243588

---->-- ja karman --<-----
Ask a Question
Discussion stats
  • 1 reply
  • 152 views
  • 0 likes
  • 2 in conversation