BookmarkSubscribeRSS Feed
Ronein
Meteorite | Level 14

Hello

The following code send an email via sas with attached XLSX file and some sentences in email body.

I want to add also to the body of email a summary report

with following code:

 

proc report data=Last_7Days_c nowd;
compute 'סטטיסטי'n;
if substr(STAT,1,4)='AMNT then
call define(_row_, "style", "style=[backgroundcolor=lightyellow]");
endcomp;
run;

Here is the code that run 100% but I need to add the summary report to body of email.

What is the way to do it?

Can you show the code please?


filename outbox EMAIL;
data _null_;
FILE outbox
to=("Joe.Dave@gmail.com") 
FROM='SAS  <Ben.Stein@gmail.com>'
subject="Summary Sales"
encoding='utf-8' 
attach=("/path/My_File.xlsx"
content_type="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
file outbox;
ODS LISTING CLOSE;
ODS HTML BODY=mail;
put "Hello ";
put "Please see attached a file with summary report";
put "population-Customers age 20-40";
put " ";
put "Regards,";
run;
1 REPLY 1

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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
  • 1 reply
  • 64 views
  • 0 likes
  • 2 in conversation