TEMPLATE Procedure: Creating a Style Template

Overview: ODS Style Templates

Using the TEMPLATE Procedure to Create a Style

The TEMPLATE procedure enables you to customize the look of your SAS output. The TEMPLATE procedure creates and modifies styles. The Output Delivery System then uses these styles to produce customized formatted output.
By default, ODS output is formatted according to the various styles that the procedure or DATA step specifies. However, you can also customize the appearance of the output by using the DEFINE STYLE statement in the TEMPLATE procedure.

Default Style for HTML

By default, ODS uses styles to display the procedure or DATA step results. Modify the appearance of the output by customizing these styles. The first output that follows shows the HTML output from PROC PRINT using the default style. The second output that follows shows the same HTML output from PROC PRINT with a customized style. The default style for HTML output is Styles.HTMLBlue.
HTML Output from PROC PRINT That Uses the Default Style (Viewed with Microsoft Internet Explorer)
HTML Output from PROC PRINT That Uses the Default Style (Viewed with Microsoft Internet Explorer)

Customized Version of the HTML Style

When you are working with styles, you are more likely to modify a SAS style than to write a completely new style. The next display shows the types of changes that you can make to the default style for the HTML output. The new style affects both the contents file and the body file in the HTML output. In particular, in the contents file, the style makes changes to the following attributes:
  • the background of the contents file
  • the background of the contents title
  • the name of the table of contents (Contents instead of Table of Contents)
In the body file, the new style makes changes to the following attributes:
  • the text of the header and the text that identifies the procedure that produced the output
  • the colors for some parts of the text
  • the colors of the borders
  • the background colors
HTML Output from PROC PRINT with the Customized Style (Viewed with Microsoft Internet Explorer)
HTML Output from PROC PRINT with the Customized Style (Viewed with Microsoft Internet Explorer)