Desktop productivity for business analysts and programmers

ERROR: An attachment record was truncated. The attachment LRECL is too small.

Reply
Frequent Learner
Posts: 1

ERROR: An attachment record was truncated. The attachment LRECL is too small.

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

Super User
Posts: 13,913

Re: ERROR: An attachment record was truncated. The attachment LRECL is too small.

Posted in reply to Pravakarc

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

Super User
Posts: 10,553

Re: ERROR: An attachment record was truncated. The attachment LRECL is too small.

Posted in reply to Pravakarc

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.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
Ask a Question
Discussion stats
  • 2 replies
  • 168 views
  • 0 likes
  • 3 in conversation