Hello, I want to add two different tables/Dataset in the email body. I am using the below code to generate the email but it takes only one dataset to put it on the email body.
options emailsys=smtp emailhost=XXXXX.com emailport=25;
filename REPORT "C:\Results_Bus.html";
filename mymail email To = ("XXXX.com") From = "XXXX.com" subject="Results" content_type = "text/html"
;
ods html file=REPORT;
ods noptitle NOPROCTITLE;
PROC REPORT DATA=X nowd HEADLINE HEADSKIP
style (report) = {background = white font_size = 8pt
font_face = "Verdana" font_size = 8pt just=left}
style (column) = {background = white CELLHEIGHT = 3.5%
font_face = "Verdana" font_size = 8pt just=left}
style (header) = {foreground = cx5e2750 font_face="Verdana"
font_size = 9pt just=left
background = white} ;
run;
ods html close;
data _null_;
infile REPORT;
file mymail;
input;
if _infile_ ne '</html>' then put _infile_;
else do;
PUT '<p>** end of email****</p></html>';
END;
run;
If I add another Proc report statement with the second dataset then the email body has two title(The sas system) and looks like two different sections.. Is there a way I can remove the title and make it look like one email body...
PROC REPORT DATA=Y nowd HEADLINE HEADSKIP
style (report) = {background = white font_size = 8pt
font_face = "Verdana" font_size = 8pt just=left}
style (column) = {background = white CELLHEIGHT = 3.5%
font_face = "Verdana" font_size = 8pt just=left}
style (header) = {foreground = cx5e2750 font_face="Verdana"
font_size = 9pt just=left
background = white} ;
run;
Email Generated :
The SAS System |
A | B | C | D |
Business | 7 | 56 | 42 |
The SAS System |
X | Y | Z | XY |
Comp | 3 | 68 | 34 |
** end of email****
That might be because of your previously assigned Title, try clearing the titles by simply TITLE; This will clear all titles.
That might be because of your previously assigned Title, try clearing the titles by simply TITLE; This will clear all titles.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.