BookmarkSubscribeRSS Feed
Pravakarc
Calcite | Level 5

%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.

2 REPLIES 2
ballardw
Super User

@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.

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

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!

Register Now

Creating Custom Steps in SAS Studio

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1877 views
  • 0 likes
  • 3 in conversation