This PROC TEMPLATE step defines a table definition named phonelist. The definition defines two columns: NAME and PHONE. The GENERIC=ON suboption defines the column for NAME as one that the DATA step can use for multiple variables. The column definition uses dynamic headers; that is, a variable that uses this column defintion takes the value of the header at run time from the DATA step that uses the definition. Thus, each variable can have a different column header. STYLE= specifies a style element, Data, to use as the basis for rendering the data in this column. The font face and font size that Data normally uses are replaced by the ones that are specified in STYLE=.

The header for PHONE is hardcoded as Telephone. STYLE= specifies a style element to use for the data in this column. For information on PROC TEMPLATE, see The TEMPLATE Procedure.


/* Define the table definition 'phonelist' */
proc template;
define table phonelist;
   column name phone;
   dynamic colheader;
   define name;
      generic=on;
      header=colheader;
      style=data{font_style=italic font_size=5};
   end;

   define phone;
      header='Telephone';
      style=datafixed;
   end;
end;
run;