Customizing the Kaplan-Meier Survival Plot


Displaying Other Style Elements

You can use the approach from the previous example to display other style elements:

proc template;
   source styles.htmlblue / expand file='style.tmp';
run;

data _null_;
   infile 'style.tmp' pad;
   input line $char80.;
   file print;
   if index(lowcase(line), ' graphdata1 ') then y + 1;
   if y then put line $char80.;
   if y and index(line, ';') then stop;
run;

This example displays the GraphData1 style element. The results are displayed in FigureĀ 23.40.

Figure 23.40: GraphData1 Style Element

   class GraphData1 /                                                           
      markersymbol = "circle"                                                   
      linestyle = 1                                                             
      contrastcolor = GraphColors('gcdata1')                                    
      color = GraphColors('gdata1');                                            



The following steps display all the GraphFonts style elements from all the styles:

proc template;
   source styles / file='style.tmp';
run;

data _null_;
   infile 'style.tmp' pad;
   length style $ 80;
   retain style;
   input line $char80.;
   file print;
   if index(lowcase(line), 'define style') then style = line;
   if index(lowcase(line), ' graphfonts ') then do;
      y + 1;
      put style $char80.;
   end;
   if y then put line $char80.;
   if index(line, ';') then y = 0;;
run;

The results of this step are not displayed. You can use this approach to help you better understand the options that are available for modifying styles. The SOURCE statement specifies a single-level value of STYLES rather than a specific style name such as STYLES.HTMLBLUE, so all templates that begin with STYLES as the first level (all style templates) are written to the file. The DATA step displays all definitions of GraphFonts and the names of all styles that define the GraphFonts style element.

You can insert the name of another style element (in lowercase with a leading and trailing blank) in the preceding programs in place of 'graphdata1' or 'graphfonts'. After you display a style element, you can modify the definition and create a new style that uses the modified definition, as in the example in the section Displaying a Style and Extracting Font Information. Some of the style elements that you might want to display and modify are listed in Table 23.3.