BookmarkSubscribeRSS Feed
Programmer26
Calcite | Level 5
Hi all,
I am working on a project where i have to generate an email through sas containing a excel as attachment and a table embedded in the email body.
I am able to add the attachment but unable to embed the output in the email body.

Here is how i am doing it for attachment
Data _null_;
From=
To=
Subject=
Attach=
Content_type ="excel" ;
Email body;
Run;
This is what i am doing right now, need to incorporate the code to add output directly in the email body.
Thank you in advance.
3 REPLIES 3
r_behata
Barite | Level 11

Try This :

 

filename myfile
	email
	to=()
	cc=()
	subject=""
	attach=("");

data _null_;
	file myfile;

	if _n_=1 then
		do;
			put ' ';
			put ' <Insert Email Body Here >';
			put ' ';
			put ' Thanks!';
		end;
run;
Programmer26
Calcite | Level 5
I am able to send an email with a excel as attachment but the concern is in the other part of the question where i have to add another output which will be embedded directly in the email body like this

Good morning
Please find below top 5 countries :
Col1 col2
A. 123445
B. 1234
C. 123
D. 12
E. 1

Regards
Xyz

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
  • 3 replies
  • 1828 views
  • 0 likes
  • 3 in conversation