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

I'm using the code below to insert proc print output directly into an email message. The default font and page width do not suit the need. How does one control font size, font type and page width. Setting the sysprintfont does not do it.

Thanks for your help,

Bill

data _null_;                                                                                                                                                

filename mail email ' '                                                                                                                                     

from=("name@domain")                                                                                                                                      

to = ("name@domain")                                                                                                                                      

subject="Orders to CdL as of %sysfunc(datetime(), datetime13.)"                                                                              


proc printto print=mail new;                                                                                                                                  

run;                                                                                                                                                          

title 'Orders';                                                                                                                                               

proc print data=Orders label;                                                                                                                                 

var one two three four five six;                                                                                                                             

run;                                                                                                                                                          

proc printto;                                                                                                                                                 

run;      

1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
SAS Super FREQ

Hi:

  Well, you should be receiving an ERROR message because you do not have a semi-colon at the end of the FILENAME statement. (And I wonder what you even need the DATA _NULL_ for.) You really don't have a lot of control over the font, etc, when you use the FILENAME email engine. If you sent your PROC PRINT as an HTML or RTF or PDF attachment, you would have more control over style issues. Depending on your email restrictions (you might only be allowed Plain Text in the body of an email), SAS cannot do anything to override those defaults set by your mail administrator.

  PROC PRINTTO will cause you another issue. It is meant to capture plain text output -- either the SAS LOG or the SAS LISTING output. It is not intended to have any style characteristics. Think of PROC PRINTTO as ONLY creating an ASCII text file. An ASCII text file doesn't really have any style.

cynthia

View solution in original post

2 REPLIES 2
Cynthia_sas
SAS Super FREQ

Hi:

  Well, you should be receiving an ERROR message because you do not have a semi-colon at the end of the FILENAME statement. (And I wonder what you even need the DATA _NULL_ for.) You really don't have a lot of control over the font, etc, when you use the FILENAME email engine. If you sent your PROC PRINT as an HTML or RTF or PDF attachment, you would have more control over style issues. Depending on your email restrictions (you might only be allowed Plain Text in the body of an email), SAS cannot do anything to override those defaults set by your mail administrator.

  PROC PRINTTO will cause you another issue. It is meant to capture plain text output -- either the SAS LOG or the SAS LISTING output. It is not intended to have any style characteristics. Think of PROC PRINTTO as ONLY creating an ASCII text file. An ASCII text file doesn't really have any style.

cynthia

Bill
Quartz | Level 8

Thank you Cynthia. I'll migrate to using html. The missing semicolon is the result of a cut and paste error.

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!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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