Statistical Graphics Using ODS


The Default Template Stores and the Template Search Path

Compiled templates are stored in a template store, which is a type of item store. (An item store is a special type of SAS file.) You can see the list of template stores by submitting the following statement:

ods path show;

The results are as follows:

   Current ODS PATH list is:

   1. SASUSER.TEMPLAT(UPDATE)
   2. SASHELP.TMPLMST(READ)

These results show that the default template search path consists of Sasuser.Templat followed by Sashelp.Tmplmst. You can add template stores that you create, or you can change the order in which the template stores are searched. For more information, see the sections Saving Customized Templates, Using Customized Templates, and Reverting to the Default Templates in ChapterĀ 22: ODS Graphics Template Modification, and the sections The ODS PATH Statement and Controlling Output Appearance with Templates in ChapterĀ 20: Using the Output Delivery System.

This section discusses the default template stores that you use when you have not modified the template search path by using the ODS PATH statement. By default, templates that you write are stored in Sasuser.Templat. If you store a modified template in Sasuser.Templat, ODS finds and uses your modified template. Otherwise, ODS finds the templates that it provides in Sashelp.Tmplmst. You can see a list of all the templates that you have modified as follows:

proc template;
   list / store=sasuser.templat;
run;

You can delete any template that you modified (so that ODS finds the default SAS template) by specifying it in a DELETE statement, as in the following statement:

proc template;
   delete Stat.REG.Graphics.ResidualPlot / store=sasuser.templat;
run;

Specifying STORE=SASUSER.TEMPLAT is not required. However, if you have administrator privileges on your computer, this option helps you ensure that you do not accidentally delete templates from Sashelp.Tmplmst. Unless you have administrator privileges, ODS never deletes a template in Sashelp.Tmplmst, so you can safely run the preceding step without the STORE= option, even if the template that you specify does not exist in Sasuser.Templat. You can run the following step to delete the entire Sasuser.Templat store of customized templates so that ODS uses only the templates that SAS supplies:

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

It is good practice to delete templates that you have customized when you are done using them, so that they are not unexpectedly used later. For more information, see the section Reverting to the Default Templates in ChapterĀ 22: ODS Graphics Template Modification.