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