BookmarkSubscribeRSS Feed
Citrine10
Obsidian | Level 7

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;
6 REPLIES 6
Citrine10
Obsidian | Level 7
thank you however still only getting the one table and not the second table
Cynthia_sas
SAS Super FREQ
Hi:
Since many mail systems prohibit sending or receiving HTML formatted email, I would recommend making a PDF file for your two reports -- a single PDF can contain multiple PROC REPORT output and you can insert explanatory text into the PDF file between the reports. Then you can send the PDF file as an attachment. This may be a better approach in the long run because it will simplify the text in the body of the email and push the report formatting into the PDF file.
That's my .02 on your email approach,
Cynthia
Citrine10
Obsidian | Level 7

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

Kurt_Bremser
Super User

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: 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
  • 6 replies
  • 1067 views
  • 0 likes
  • 3 in conversation