BookmarkSubscribeRSS Feed
MikeRhoads
Obsidian | Level 7
I would like to create a new template store that would contain 2 style templates:
(1) Printer92, which would be identical to Printer from sashelp.tmplmst,
(2) Printer, which would be identical to the original Printer except for the fonts.

The idea is that users could prepend the new template store in their ODS PATH statement, so they could get different fonts in their PDF output without having to specify style= on each ODS PDF statement, and without overwriting the SAS-supplied Printer style.

After looking into a number of ways to do this, the best (mentioned in a Tech Support note) seemed to be to use the EDIT statement in PROC TEMPLATE (full code below). This seems to work fine, and to be platform and version-independent. My only worry is that I don't see the EDIT statement in the 9.2 documentation for style templates. (I do see it for table templates.)

So, I'm wondering whether this use of EDIT has been deprecated with the 9.2 style syntax changes, and if there are some hidden dangers with it. (Or maybe I just missed it in the documentation?)

proc datasets library=work nolist nowarn;
delete pdf913 / memtype=itemstor;
quit;

proc template;
path work.pdf913 (UPDATE) sashelp.tmplmst (READ);
edit styles.printer as styles.printer92;
end;
edit styles.printer;
style fonts /
'TitleFont2' = ("Times",12pt,bold italic)
'TitleFont' = ("Times",13pt,bold italic)
'StrongFont' = ("Times",10pt,bold)
'EmphasisFont' = ("Times",10pt,italic)
'FixedEmphasisFont' = ("Courier",9pt,italic)
'FixedStrongFont' = ("Courier",9pt,bold)
'FixedHeadingFont' = ("Courier",9pt,bold)
'BatchFixedFont' = ("Courier",6.7pt)
'FixedFont' = ("Courier",9pt)
'headingEmphasisFont' = ("Times",11pt,bold italic)
'headingFont' = ("Times",11pt,bold)
'docFont' = ("Times",10pt);
end;
run;

ods path (prepend) work.PDF913 (READ);
1 REPLY 1
Cynthia_sas
Diamond | Level 26
Hi, Mike:
I have only seen the EDIT statement used with TABLE templates...so I can't speak to the issue of whether 1) it ever worked with STYLE templates or 2) if it worked, whether it will continue to work with 9.2....

This might be a better question for the ODS folks in Tech Support.

cynthia

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

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 1 reply
  • 1102 views
  • 0 likes
  • 2 in conversation