Statistical Graphics Using ODS


Changing the Default Style

The default style for each ODS destination is specified in the SAS Registry. For example, the default style for the HTML destination is DEFAULT (or HTMLBLUE in the SAS windowing environment) and the default style for the RTF destination is RTF. You can specify a default style for all of your output in a particular ODS destination. This is useful if you want to use a different SAS style, if you have modified one of the styles supplied by the SAS System (see the section Style Templates and Colors), or if you have defined your own style. For example, you can specify the JOURNAL style as the default style for RTF output.

The recommended approach for specifying a default style is as follows. Open the SAS Registry Editor by typing regedit on the command line. Expand the node ODS $\blacktriangleright $ DESTINATIONS and select a destination (for example, select RTF). Double-click the Selected Style item, shown in FigureĀ 21.60, and specify a style. This can be any style supplied by the SAS System or a user-defined style, as long as it can be found with the current template search path (for example, specify Journal). You can specify a default style for the other destinations in a similar way.

In a few cases the default style is specified in more than one place. Assume that you are using the SAS windowing environment and Microsoft Windows or UNIX in the following;

  • If you expand the node ODS $\blacktriangleright $ DESTINATIONS $\blacktriangleright $ HTML, you see that the Selected Style is DEFAULT.

  • If you expand the node ODS $\blacktriangleright $ MARKUP $\blacktriangleright $ HTML4, you see that the Selected Style is DEFAULT.

  • If you expand the node ODS $\blacktriangleright $ DMS $\blacktriangleright $ DESTINATIONS $\blacktriangleright $ MARKUP $\blacktriangleright $ HTML4, you see that the Selected Style is HTMLBLUE.

The HTMLBLUE style is the default style for HTML output in the SAS windowing environment, yet the DEFAULT style is the default style for HTML output in other contexts.

Figure 21.60: SAS Registry Editor

SAS Registry Editor


ODS searches sequentially through each element of the template search path for the first style template that matches the name of the style specified in the SAS Registry. The first style template found is used. (See the sections Saving Customized Templates, Using Customized Templates, and Reverting to the Default Templates in ChapterĀ 22: ODS Graphics Template Modification, for more information about the template search path.) If you are specifying a customized style as your default style, the following are useful suggestions:

  • If you save your style in Sasuser.Templat, verify that the name of your default style matches the name of the style specified in the SAS Registry. For example, suppose the RTF style is specified for the RTF destination in the SAS Registry. You can name your style RTF and save it in Sasuser.Templat. This blocks the RTF style in Sashelp.Tmplmst (provided that you did not alter the default template search path).

  • If you save your style in a user-defined template store, verify that this template store is the first in the current template search path. Include the ODS PATH statement in your SAS autoexec file so that it is executed at start-up.

For the HTML destination, an alternative approach for specifying a default style is as follows. From the menu at the top of the main SAS window, select Tools $\blacktriangleright $ Options $\blacktriangleright $ Preferences. On the Results tab, select the Create HTML check box and select a style from the Style list.