Help using Base SAS procedures

Font Control in Email

Accepted Solution Solved
Reply
Super Contributor
Posts: 292
Accepted Solution

Font Control in Email

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;      


Accepted Solutions
Solution
‎05-14-2015 03:11 PM
SAS Super FREQ
Posts: 8,868

Re: Font Control in Email

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


All Replies
Solution
‎05-14-2015 03:11 PM
SAS Super FREQ
Posts: 8,868

Re: Font Control in Email

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

Super Contributor
Posts: 292

Re: Font Control in Email

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

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

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