Email body with embedded table from dataset

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 13
Accepted Solution

Email body with embedded table from dataset

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****


Accepted Solutions
Solution
‎04-17-2018 12:26 PM
Valued Guide
Posts: 597

Re: Email body with embedded table from dataset

Posted in reply to Melvin_Sas

That might be because of your previously assigned Title, try clearing the titles by simply TITLE; This will clear all titles.

Thanks,
Suryakiran

View solution in original post


All Replies
Solution
‎04-17-2018 12:26 PM
Valued Guide
Posts: 597

Re: Email body with embedded table from dataset

Posted in reply to Melvin_Sas

That might be because of your previously assigned Title, try clearing the titles by simply TITLE; This will clear all titles.

Thanks,
Suryakiran
☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 1 reply
  • 156 views
  • 1 like
  • 2 in conversation