%macro Email_notification(subject=,Message=);
filename mail email to=('pravakar.chaudhury@xx.com' ) type='text/html'
subject="'LDAP Sync JOB Completed In PROD.'" ATTACH=('/projects/so/Pravakar/user_Added.html'
'/projects/so/Pravakar/User_Deleted.html' '/projects/so/Pravakar/User_Updated.html' LRECL=9999);
data _null_;
file mail;
Put "Hi Admins" ;
put " SAS Metadata and LDAP Sync job has 'Updated Metadata successfully. ' " ;
Put " Number of Users Added , " ;
Put " Number of Users Deleted , " ;
Put "Number of Users Metadata Updated . " ;
run;
%mend Email_notification;
%Email_notification;
I am getting "ERROR: An attachment record was truncated. The attachment LRECL is too small."
I have used CONTENT_TYPE='text/html' also but got same ERROR.
Please suggest.
@Pravakarc wrote:
%macro Email_notification(subject=,Message=);
filename mail email to=('pravakar.chaudhury@xx.com' ) type='text/html'
subject="'LDAP Sync JOB Completed In PROD.'" ATTACH=('/projects/so/Pravakar/user_Added.html'
'/projects/so/Pravakar/User_Deleted.html' '/projects/so/Pravakar/User_Updated.html' LRECL=9999);
data _null_;
file mail;
Put "Hi Admins" ;
put " SAS Metadata and LDAP Sync job has 'Updated Metadata successfully. ' " ;
Put " Number of Users Added , " ;
Put " Number of Users Deleted , " ;
Put "Number of Users Metadata Updated . " ;
run;%mend Email_notification;
%Email_notification;
I am getting "ERROR: An attachment record was truncated. The attachment LRECL is too small."
I have used CONTENT_TYPE='text/html' also but got same ERROR.
Please suggest.
You have specified a value of 9999 for LRECL (logical record length) option for your attachments. The error indicates that one or more of your attachments has more than 9999 characters on a logical record without encountering an end of record marker. A likely candidate cause could be embedded graphics. I would recommend increasing the value of LRECL but if there are graphics you might spend some time trying to guess a value that works correctly. If the maximum value for LRECL=32767 does not work you need to examine your attachments carefully to find out why they are exceeding that size and address it in creating them or use a different approach to attaching the files.
Also note that a text file created on UNIX (html is text) will have only LF for end-of-line, which will not be recognized on Windows, as it needs CRLF.
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
Check out this tutorial series to learn how to build your own steps in SAS Studio.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.