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

I am trying to add some text to a daily process that creates some PDF's, attaches them to an email, writes a proc tabulate table to the body of the email and sends.  I normally would use a data _null_ and put statement to write text to the body of the email, but that seems to generate a second email rather than writing to the same email.  I have tried ODS HTML TEXT as well with the same result.  Does anyone know how to accomplish this?  Thanks!

/* Send Email */

option emailhost='localhost';

filename mymail email

  from="me"

  sender="me"

  to= ("me")

  subject="Tracking"

  content_type="text/html"

  attach = ('Sample1.pdf'  'Sample2.pdf'');

ods MSOffice2K

body=mymail

style=BarrettsBlue;

<proc tabulate code>

ods msoffice2k close;

goptions reset=all;

1 ACCEPTED SOLUTION

Accepted Solutions
Chevell_sas
SAS Employee

Try using the ODS MSOffice2K TEXT= option to add your text that you would like to display in the body of the email.


filename mymail email
  to= ("me.com")

  subject="Tracking"

  content_type="text/html";

 

ods MSOffice2K

body=mymail

style=BarrettsBlue;

ods msoffice2k text="this is a test";

proc tabulate data=sashelp.class;
class age;
var height;
table age,height;
run;

ods msoffice2k close;

View solution in original post

2 REPLIES 2
Chevell_sas
SAS Employee

Try using the ODS MSOffice2K TEXT= option to add your text that you would like to display in the body of the email.


filename mymail email
  to= ("me.com")

  subject="Tracking"

  content_type="text/html";

 

ods MSOffice2K

body=mymail

style=BarrettsBlue;

ods msoffice2k text="this is a test";

proc tabulate data=sashelp.class;
class age;
var height;
table age,height;
run;

ods msoffice2k close;

P5C768
Obsidian | Level 7

Thanks.  Works perfectly.  Might you also now how to control line breaks in ods MSOffice2K?  When I use the HTML breaks I would use for ODS HTML, it does not apply them.  Or how to control the font?  Style(fontweight=BOLD) does not seem to work.

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
  • 2 replies
  • 2026 views
  • 0 likes
  • 2 in conversation