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.

Catch up on SAS Innovate 2026

Dive into keynotes, announcements and breakthroughs on demand.

Explore 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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 3525 views
  • 0 likes
  • 2 in conversation