BookmarkSubscribeRSS Feed
Ronein
Meteorite | Level 14

Hello

I wan tto send an email via SAS with following information:

1- In body email add a summary table ( Data set-summary_report)

2-In body email write a few sentences :

Hello,

Please find attached a summary report on sashelp.cars 

Kind Regards,

Joe

3-Attach 2 files in one Excel file (It means that attach one excel file with 2 sheets)

Attach1-summary_report

Attach2-sashelp.cars raw data

What is the code the perform this task?

Should I export the 2 files first ?

 



proc summary data=sashelp.cars;
class origin;
var msrp;
output out=summary_report mean=;
run;

proc export 
data=sashelp.cars
dbms=xlsx 
outfile="/usr/local/SAS/SASUsers/LabRet/UserDir/udclk79/cars.xlsx"
replace;
sheet='Raw_Data_Cars';
run;

proc export 
data=summary_report
dbms=xlsx 
outfile="/usr/local/SAS/SASUsers/LabRet/UserDir/udclk79/cars_summary_report.xlsx"
replace;
sheet='Raw_Data_Cars';
run;

 

 

 

 

3 REPLIES 3
Kurt_Bremser
Super User
  • Create the Excel files
  • Define a FILENAME EMAIL with the ATTACH= option for the files
  • Open a ODS HTML destination to the email file
  • Run the summary report, and PROC ODSTEXT for the text
  • Close the ODS destination (the mail will be sent at that point)
Ronein
Meteorite | Level 14

Can you please show the code?

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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