Hey Chris, Just an FYI. Running SAS 9.4M7 EBI here. I had to modify the attachment line to get the excel readable. I needed to specify the content type in the attachment. Loved the "%sysfunc(getoption(WORK))/roster.xlsx" and %sysfunc(pathname(out)) code. This will allow my customers to keep their attachments in temp space! Thanks filename out "%sysfunc(getoption(WORK))/roster.xlsx";
proc export data=sashelp.class outfile=out dbms=xlsx replace;
run;
proc sql noprint;
select count(name)
into: size TRIMMED from sashelp.class;
quit;
filename outbox EMAIL
to="email@address"
from="email@address"
subject="Your new class list: &size members" attach="%sysfunc(pathname(out))" /*Did NOT work*/
attach=("%sysfunc(pathname(out))" content_type="application/xlsx") /* Worked !!!*/
;
data _null_;
file outbox;
put "Here's your roster!";
run;
... View more