Desktop productivity for business analysts and programmers

SAS Enterprise Guide Email Multiple Attachments

Occasional Contributor
Posts: 8

SAS Enterprise Guide Email Multiple Attachments

My company has recently switched to SAS Enterprise Guide, and one of my responsibilities is to email out large batches of emails with multiple attachments. I know that to attach .xlsx files you need to add the line

content_type="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" lrecl=32000

 to your attach= statement.


I have verified that each individual attachment works but when I try to send all attachments at once, only the last one attached can be opened. Every other attachment is corrupted and can't be viewed. Any help would be appreciated, thank you.


%macro emaildata (to_address, attachments);
 Filename output email;
 data _null_;
	file output
	to = (&to_address.)
	subject = "Subject Line"
	attach = (&attachments. content_type="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" lrecl=32000);

 put "text."; 

%mend emaildata;

/* Test */
%emaildata ('recipient', "&attach1." "&attach2." "&attach3." "&attach4." "&attach5." "&attach6.");
Trusted Advisor
Posts: 2,121

Re: SAS Enterprise Guide Email Multiple Attachments

[ Edited ]



I don't have an answer to using the macro. 


Sometimes EGuide works better if you use its tools.  If you have a file to send, right click on it and select 'send to' and then 'email as a step in the project'.  Once you've added one file, you can add others.  It's pretty flexible about sending data and reports.


{Added}.  You need to do some setup in tools--> options and the mail is sent from your pc, not from the server.

Ask a Question
Discussion stats
  • 1 reply
  • 2 in conversation