Hello,
I want to send email from SAS and in the email will have:
1-Attach XLSX file with summary data (summary data set)
2-Attach XLSX file with raw data (sashelp.cars data set)
3-In email Body print summary data (summary data set)
In the code below I attach one file (summary data)
My question-What is the way to attach also raw data (sashelp.cars data set)?
proc sql;
create table summary as
select type,
sum(invoice) as sum_invoice
from sashelp.cars
group by type
;
quit;
/**CREATE EXCEL FILE***/
ODS EXCEL FILE="/usr/local/SAS/SASUsers/LabRet/UserDir/udclk79/summary_Report_Cars.xlsx" style=htmlblue options(
frozen_headers="ON"
/*autofilter = "1-17" */
row_heights="30,13,13,13,13,13,13"
flow = "header, data"
absolute_column_width = "18,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10"
sheet_name = "Cars"
) ;
title;
footnote;
title1 'Smmary of cars';
proc print data=summary noobs;
Run;
ods excel close;
FILENAME mail EMAIL
TO=("Ron.gdansk@gmail.com")
FROM='SAS <Ron.Einstein@BankLeumi.co.il>'
SUBJECT="Cars"
encoding='utf-8'
CONTENT_TYPE="text/html"
encoding="utf-8"
attach=("/usr/local/SAS/SASUsers/LabRet/UserDir/udclk79/summary_Report_Cars.xlsx" content_type="excel");
/*******Here I want to attach also another data set called sashelp.cars****/
ODS LISTING CLOSE;
ODS HTML BODY=mail;
/*** EMAIL BODY TEXT**********/
title;
footnote;
title JUSTIFY=center color="purple" height=25pt bold italic underlin=1 'Cars';
proc report data=summary nowd;
column _all_;
run;
... View more