BookmarkSubscribeRSS Feed
Fluorite | Level 6

Hi everyone!


How can I duplicate my few reports (proc report)  in email body and like attachment pdf? mayby you know some examples? I find only like attachment or in body messege, bot not both together.


Thx for help!


Opal | Level 21


My general rule of thumb is: It shouldn't take me longer to answer a question than it should take you to formulate the question. 


So yes, such things can be done. I'd question though why would you want to do this. ODS allows you to write output to multiple output destinations. ....and now I've spent already more time answering your question than you spent asking the question so I'm stopping right here.

Fluorite | Level 6

@Patrick Thank you for answer! Good rule 🙂
One more little question: is it done on the date step?

How to put this doc (or pdf) file in the body of the letter in this case, if possible?

Like example:

data _null_;

file outmail to=""

subject="Sales Report"

attach="c:\reports\Sales Report.doc";

put 'Dear team,';



Opal | Level 21


Now I understand what you're trying to do. Have the attachment directly in the body of your mail.



As far as I understand things this is only possible with RTF formatted emails and the "attachment" is actually no more a real email attachment defined via the attachment directive but it's an embedded object in RTF.

So to get to this you would need to create such an RTF formatted message. You'll find docu and whitepapers how to generate and send RTF formatted emails but I haven't found any example for also embedding objects. I'd assume it can be done but will need a bit of work.


Playing around in Outlook I haven't been able to have the exactly same pdf both within the body of the message and in the attachment line - so that's eventually something which can't work at all using Outlook.


Your call if you want to spend the time for this. I probably wouldn't bother and just attach the file. 

Fluorite | Level 6

@Patrick Not quite, I need like at pic. below. I need it because not all devices correctly display the report in the letter and there is a need to duplicate in the PDF format. Thx for helping!


Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 2 in conversation