BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Melvin_Sas
Fluorite | Level 6

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

1 ACCEPTED SOLUTION

Accepted Solutions
SuryaKiran
Meteorite | Level 14

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

1 REPLY 1
SuryaKiran
Meteorite | Level 14

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

Thanks,
Suryakiran

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
  • 1 reply
  • 7953 views
  • 1 like
  • 2 in conversation