01-24-2018 02:20 PM
I've been able to use Base SAS to produce a perfect ODS RTF file for my needs. Now I want to do the same thing in batch mode in Unix. Everything works fine except font - in Base SAS, I had been using proc template to set font to Georgia globally:
ods path(prepend) work.templat(update); *Added this in Unix batch mode code because of a separate issue; proc template; define style styles.hello; class usertext / font_size = 11pt font_face = Georgia; class body / topmargin = 1.0in leftmargin = 0.75in rightmargin = 0.75in; end; run;
When I try this in batch mode, I get this nice log note right after that step: NOTE: STYLE 'Styles.hello' has been saved to: WORK.TEMPLAT
But at the very end of my log, after all of my ods rtf text= statements and my ods rtf close statement, I get multiple of these warnings:
WARNING: Font specification "Georgia" failed. Using default font family instead.
Margins and font_size are all fine in the output, it's just the font that did not work. I've tried changing the font through inline formatting for individual text= statements too, but it didn't work (though font_weight and foreground color worked that way). Thus my guess is that the proc template syntax is fine, but the font isn't registered or something like that.
Any ideas on how to solve this? I've googled it pretty thoroughly and haven't found anything. I need to use Georgia because it's an official organization font.
01-24-2018 05:21 PM
01-24-2018 02:27 PM
You need to install the font into your system, which I don't think is a SAS specific issue.
Or maybe it's not in your library of SAS fonts, but for some reason I think it uses the system fonts.
01-24-2018 05:10 PM
01-24-2018 05:21 PM
01-24-2018 06:37 PM
Thanks for your response! It worked!
After some digging, I established that Georgia is in fact installed on my Unix system and located its path. I then added to the top of my code a proc fontreg mode=add with fontpath directing to that directory. I got a really encouraging message:
Files processed: 82
Unusable files: 3
Files identified as fonts: 79
Fonts that were processed: 79
Fonts replaced in the SAS registry: 0
Fonts added to the SAS registry: 0
Fonts that could not be used: 79
Font Families removed from SAS registry: 0
It did not give me the previous error relating to Georgia failing, instead it gave this:
"ERROR: An exception has been encountered.
Please contact technical support and provide them with the following traceback
The SAS task name is [SQL (2) ]
Underneath was a bunch of lines referencing the SAS 9.4 folder in the Unix system.
I was about to post this new problem when I tried running the same code again - and the second time got no error message and the output is in Georgia! Let's hope it continues to do this on a monthly basis or I'll have to come back here lol.
Thanks to both of you for the extremely relevant help!!!
Need further help from the community? Please ask a new question.