%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.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.