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-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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