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 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

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

Browse our catalog!

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