BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
PaigeMiller
Diamond | Level 26

I am a beginner at PROC TEMPLATE. I follow the PROC TEMPLATE example here: https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/odsproc/n1sbdyv873pfcmn1e3a8p2z4k055.htm and now my PROC FREQ shows the frequency counts in format comma12. Works as expected. But then, I want to do another PROC FREQ later in the same program with the default format for frequency counts, how do I return to the default format? Is it simply running PROC TEMPLATE again with the BEST7. format for frequency counts?

 

Is the some way to save the template with comma12. format and call it as needed?

--
Paige Miller
1 ACCEPTED SOLUTION

Accepted Solutions
ChrisHemedinger
Community Manager

If you followed the example then you probably used ODS PATH to add a "search" path for your custom templates. You can use ODS PATH with a REMOVE option to stop SAS from looking there, and bypass your custom template.

 

Best practice is to keep your custom templates in a location you control, and don't override the ones that ship with SAS (in the SASHELP location). 

SAS Hackathon registration is open! Build your skills. Make connections. Enjoy creative freedom. Maybe change the world.

View solution in original post

2 REPLIES 2
Cynthia_sas
SAS Super FREQ
Hi:
Basically, you need to create your changed template for PROC FREQ in a separate template store location. And then when you want to use the default template for PROC FREQ, you'll control the search path for the template stores by using an ODS PATH statement.
Take a look at this paper https://www.lexjansen.com/wuss/2009/tut/TUT-Zender.pdf -- I used the EDIT statement to create an edited template in WORK.SUMTEMP and because that was the first template store in the search path, anytime I use PROC MEANS, my changed template will be used. However, if I issue a new ODS PATH statement WITHOUT WORK.SUMTEMP in the path list, then the original template for PROC MEANS will be found.
When you are changing table templates associated with procedures, you cannot change the name of the table template that will be called by the procedure. All you can do is change the search path to find that template. That is what the ODS PATH statement allows you to do.
In practice, however, I rarely use a table template change for cosmetic things like formats or labels. Typically, I use ODS OUTPUT or the OUTPUT statement to create a data set and then I just use PROC PRINT or PROC REPORT to generate the final report with the formats/labels that I want.
Cynthia
ChrisHemedinger
Community Manager

If you followed the example then you probably used ODS PATH to add a "search" path for your custom templates. You can use ODS PATH with a REMOVE option to stop SAS from looking there, and bypass your custom template.

 

Best practice is to keep your custom templates in a location you control, and don't override the ones that ship with SAS (in the SASHELP location). 

SAS Hackathon registration is open! Build your skills. Make connections. Enjoy creative freedom. Maybe change the world.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 359 views
  • 1 like
  • 3 in conversation