hi
I am trying to combine various HTML reports into one email with different headings, one saying 'update 1' then the table, then 'update 2' then the table however they currently arriving in my inbox as seperate emails. See code below
FILENAME MailBox EMAIL TO=(jackie@gmail.com) FROM='horat@gmail.com' type='text/html' SUBJECT='Update to tables'; ODS html body=Mailbox style = noline; ods html text = "Update1"; ods html text = ""; ods listing close; PROC REPORT DATA=WORK.updates nowd HEADLINE HEADSKIP style (report) = {background = white font_face = "Verdana" font_size = 7pt just=left bordercolor=grey rules=All frame=box} style (column) = {background = white CELLHEIGHT = 2.5% font_face = "Verdana" font_size = 7pt just=left } style (header) = {foreground = cx5e2750 font_face="Verdana" font_size = 8pt just=left }; columns _All_; run; ods html close; PROC REPORT DATA=WORK.updates2 nowd HEADLINE HEADSKIP style (report) = {background = white font_face = "Verdana" font_size = 7pt just=left bordercolor=grey rules=All frame=box} style (column) = {background = white CELLHEIGHT = 2.5% font_face = "Verdana" font_size = 7pt just=left } style (header) = {foreground = cx5e2750 font_face="Verdana" font_size = 8pt just=left }; columns _All_; run;
Move the
ods html close;
statement after the final report. Closing the destination causes the mail to be sent.
hi, thank you however we want the table to be to the eye when opening the mail and not have it in a PDF doc
Post your complete log, from the ODS HTML statement to the ODS HTML CLOSE statement, including all messages coming after the ODS HTML CLOSE.
This simple example code results in a single mail with two reports:
filename mm
email
to="redacted@domain.com"
subject="SAS mail"
type="text/html"
;
ods html file=mm;
proc report data=sashelp.class;
column sex name age;
define sex / group;
define name / display;
define age / mean;
rbreak after / summarize;
run;
proc report data=sashelp.class;
column sex weight;
define sex / group;
define weight / mean;
run;
ods html close;
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.