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

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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