Help using Base SAS procedures

How can I remove the modified template and go back to the default?

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 75
Accepted Solution

How can I remove the modified template and go back to the default?

A few days ago I came across a program to modify the crosstabs template and tried it as follows:

 

proc template;
define crosstabs Base.Freq.CrossTabFreqs;
cellvalue frequency percent rowpercent colpercent;
define frequency;
format=8.;
header='Count';
end;
define percent;
format=pctfmt.;
header='Overall %';
end;
define rowpercent;
format=pctfmt.;
header='Row %';
end;
define colpercent;
format=pctfmt.;
header='Col %';
end;
end;
run;

 

It worked but as I wanted to go back, the source I read unfortunately didn't instruct clearly how to switch to default template. Since then I've been using this:

 

ods path sashelp.tmplmst(read) sasuser.templat(update);

 

to go back to default template. If I don't run that ods, the modified template will show up.

My question is: How can I remove the modified template permanently?

I find a program on SAS User's Guide page to delete the entire SASUSER.Templat store of customized templates, not sure if it can solve my problem.

 

ods path sashelp.tmplmst(read);
proc datasets library=sasuser nolist;
   delete templat(memtype=itemstor);
run;
ods path sasuser.templat(update) sashelp.tmplmst(read);

Accepted Solutions
Solution
‎09-25-2015 06:23 AM
Super User
Super User
Posts: 7,942

Re: How can I remove the modified template and go back to the default?

Posted in reply to NonSleeper

If you goto Results  (in SAS that is), and right click on the word Results in the Results window, you will see a Templates option on the menu.  This will give you a tree view of the libraries and templates within them, you can add or remove from there.  I would caution you to be careful with thetemplates, I would always create a library for them separate to your code - principally as they may be used by more than one person which is one of the reasons for them.  Then put your templates in there and load them within your autoexec.sas.  

View solution in original post


All Replies
Solution
‎09-25-2015 06:23 AM
Super User
Super User
Posts: 7,942

Re: How can I remove the modified template and go back to the default?

Posted in reply to NonSleeper

If you goto Results  (in SAS that is), and right click on the word Results in the Results window, you will see a Templates option on the menu.  This will give you a tree view of the libraries and templates within them, you can add or remove from there.  I would caution you to be careful with thetemplates, I would always create a library for them separate to your code - principally as they may be used by more than one person which is one of the reasons for them.  Then put your templates in there and load them within your autoexec.sas.  

Frequent Contributor
Posts: 75

Re: How can I remove the modified template and go back to the default?

[ Edited ]

The screen shot below is what I find on the template menu of SAS Results. It looks like the customized template is stored on Sasuser.Templat => Base => Freq => CrossTabFreqs

 

So I guess I need to delete that customized template to go back to default template, is that correct? Will the deletion be the CrossTabFreqs only, or the whole folders Base and/or Freq? I've come across warnings when manipulating on templates so just want to be sure. I think I will avoid messing with this stuff for a while.

 

UPDATE: I deleted CrossTabFreqs and things look fine now.

 

Template.png

🔒 This topic is solved and locked.

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

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