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
Diamond | Level 26

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
Diamond | Level 26

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.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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