To change the output from a procedure using a table template, PROC TEMPLATE can be used to edit the table template. It is not possible to apply more than one format to a column in a table. However, the TRANSLATE statement can be used to change the look of one or more rows.
The sample PROC TEMPLATE code below creates two tables. The default output is displayed in the first one. The PROC TEMPLATE code uses the TRANSLATE statement to change the look of the Levels column only for the row where the Name column's value is AIR.
ods html file="file.html";
ods select members;
title "Default output with unedited table template";
proc datasets library=sashelp mt=data;
run;
quit;
ods path work.template(update) sashelp.tmplmst;
proc template;
edit base.datasets.members;
edit level;
format=3.;
translate (name='AIR') into put(_val_,dollar3.);
end;
end;
run;
ods select members;
title "Table template using the TRANSLATE statement";
proc datasets library=sashelp mt=data;
run;
quit;
ods html close;
/* Delete the updated table template, if desired */
proc template;
delete base.datasets.members;
run;
Here is the first default output table:
Here is the output created using the TRANSLATE statement:
To apply a format to a cell or multiple cells within a row with PROC REPORT, seeĀ SAS Note 38776, "How to apply a format to a cell or multiple cells within a row with PROC REPORT."