SUPPORT / SAMPLES & SAS NOTES
 

Support

Usage Note 39996: "ERROR: An attachment record was truncated" when sending files as email attachments

DetailsAboutRate It

When sending files as SMTP email attachments from SAS® 9.2 and later, the following error might occur:

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

However, increasing the value of LRECL does not prevent the error.

To circumvent, specify the CONTENT_TYPE= (or CT=) option in the FILENAME statement for the attachment as shown in the example below:

   filename sendit email from="user@company.com" 
   to="someone@domain.com" 
   subject="Excel files from SAS"
   attach=("myfile.xls" content_type="application/vnd.ms-excel");

The value for CONTENT_TYPE can be determined by looking at the MIME type of the file. For example, some common file extensions with content_type values are:

    *.html  text/html
    *.pdf   application/pdf
    *.rtf   application/rtf
    *.xls   application/vnd.ms-excel



Operating System and Release Information

Product FamilyProductSystemProduct ReleaseSAS Release
ReportedFixed*ReportedFixed*
SAS SystemBase SASSolaris for x649.219.2 TS2M0
Linux for x649.219.2 TS2M0
OpenVMS on HP Integrity9.219.2 TS2M0
HP-UX IPF9.219.2 TS2M0
Linux9.219.2 TS2M0
64-bit Enabled Solaris9.219.2 TS2M0
64-bit Enabled HP-UX9.219.2 TS2M0
64-bit Enabled AIX9.219.2 TS2M0
SAS SystemN/Az/OS9.2 TS1M0
Microsoft® Windows® for 64-Bit Itanium-based Systems9.2 TS1M0
Microsoft Windows Server 2003 Datacenter 64-bit Edition9.2 TS1M0
Microsoft Windows Server 2003 Enterprise 64-bit Edition9.2 TS1M0
Microsoft Windows XP 64-bit Edition9.2 TS1M0
Microsoft® Windows® for x649.2 TS1M0
Microsoft Windows Server 2003 Datacenter Edition9.2 TS1M0
Microsoft Windows Server 2003 Enterprise Edition9.2 TS1M0
Microsoft Windows Server 2003 Standard Edition9.2 TS1M0
Microsoft Windows XP Professional9.2 TS1M0
Windows Vista9.2 TS1M0
Windows Vista for x649.2 TS1M0
64-bit Enabled AIX9.2 TS1M0
64-bit Enabled HP-UX9.2 TS1M0
64-bit Enabled Solaris9.2 TS1M0
HP-UX IPF9.2 TS1M0
Linux9.2 TS1M0
Linux for x649.2 TS1M0
OpenVMS on HP Integrity9.2 TS1M0
Solaris for x649.2 TS1M0
* For software releases that are not yet generally available, the Fixed Release is the software release in which the problem is planned to be fixed.