Simple Modifications to ODS Styles

While ODS provides the ability to produce SAS output in a variety of forms, sometimes the default appearance of ODS output does not meet your needs, or simply doesn't look the way you'd like it to. As a simple example, consider the RTF (Rich Text Format) ODS destination. Here's a simple example of ODS RTF output for a simple PROC PRINT:
filename world url 'http://www.stat.berkeley.edu/classes/s100/data/world.csv';

data world;
   infile world dlm=',' dsd;
   input name $ cont $ gdp income literacy milspend nphys undate yymmdd10.;
run;

options nodate nonumber;
title 'Data on Countries of the World';
ods rtf file='world.rtf';
proc print data=world noobs;
   format undate mmddyyS10.;
run;
ods rtf close;

Here's what the output looks like when inserted into a word processor:
What I'd like to do is change the headings so that the background is white instead of gray. To find out how to do this, we must first see what the default template for RTF output looks like. Go to View->Results in the SAS Explorer Window, and then View->Templates. Here's what you'll see:
The template I'm looking for is in Sashelp.Tmplmst, so click the plus sign to the left of that name, and scroll down to the Styles folder; double-clicking on the Styles folder reveals a list of styles; scroll down to Rtf. Finally, double click on Rtf to reveal the following window:
In that window, you can see an entry labeled 'bgH' = grayBB - this indicates that the background of header lines will be gray, and it's the parameter we want to change. The parameter can be modified with proc template in the following way:'
proc template;
  define style myrtf;
  parent=styles.rtf;
  replace color_list / 'bgH'=white;
  end;
run;

Notice that we specify the style that we're modifying through the parent= statement in proc template. This creates a new style, called myrtf. When we replace the ods line of the previous program with
ods rtf file='world.rtf' style=myrtf;

and rerun the program, the rtf fragment now looks like this when inserted into a word processor:



File translated from TEX by TTH, version 3.67.
On 12 Aug 2008, 11:06.