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: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 399 views
  • 0 likes
  • 2 in conversation