Sample 35896: Change the cell color of multi-way frequency PROC FREQ tables
Adding colors to your PROC FREQ output is useful when you want to highlight values. The sample program on the Full Code tab changes the color of the frequency cell values in the table cell based on the color assigned in the FORMAT procedure.
Please note that you can only add color to non-Listing destinations such as HTML, PDF, and RTF.
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.
The sample program below changes the color of the frequency cell values in the table cell based on the color assigned in the FORMAT procedure.
proc format;
value color low-2='green'
3-5='blue'
6-high='orange';
run;
proc template;
define crosstabs Base.Freq.CrossTabFreqs;
cell_style={foreground=color.};
row_total_style={foreground=color.};
col_total_style={foreground=color.};
grand_total_style={foreground=color.};
end;
run;
ods listing close;
ods html file='body.html';
proc freq data=sashelp.class;
tables age*sex / norow nocol nopercent;
run;
ods html close;
ods listing;
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.
Beginning with SAS
® 9.2, you can use the crosstabulation template for PROC FREQ to customize your non-Listing destination output.
| Date Modified: | 2010-02-03 10:45:59 |
| Date Created: | 2009-05-12 14:10:29 |
Operating System and Release Information
| SAS System | Base SAS | z/OS | 9.2 TS1M0 | |
| Microsoft® Windows® for 64-Bit Itanium-based Systems | 9.2 TS1M0 | |
| Microsoft Windows Server 2003 Datacenter 64-bit Edition | 9.2 TS1M0 | |
| Microsoft Windows Server 2003 Enterprise 64-bit Edition | 9.2 TS1M0 | |
| Microsoft Windows XP 64-bit Edition | 9.2 TS1M0 | |
| Microsoft® Windows® for x64 | 9.2 TS1M0 | |
| Microsoft Windows Server 2003 Datacenter Edition | 9.2 TS1M0 | |
| Microsoft Windows Server 2003 Enterprise Edition | 9.2 TS1M0 | |
| Microsoft Windows Server 2003 Standard Edition | 9.2 TS1M0 | |
| Microsoft Windows XP Professional | 9.2 TS1M0 | |
| Windows Vista | 9.2 TS1M0 | |
| 64-bit Enabled AIX | 9.2 TS1M0 | |
| 64-bit Enabled HP-UX | 9.2 TS1M0 | |
| 64-bit Enabled Solaris | 9.2 TS1M0 | |
| HP-UX IPF | 9.2 TS1M0 | |
| Linux | 9.2 TS1M0 | |
| Linux for x64 | 9.2 TS1M0 | |
| OpenVMS on HP Integrity | 9.2 TS1M0 | |
| Solaris for x64 | 9.2 TS1M0 | |