Procedure features: |
PROC TABULATE
statement options:
|
STYLE= option in
|
CLASSLEV statement |
|
TABLE statement | |
TABLE statement
|
crossing (*) operator |
|
STYLE_PRECEDENCE= option | |
|
Other features: |
ODS HTML statement |
FORMAT statement |
|
Data set: |
SALES
|
This example
-
creates a category for each sales
type, retail or wholesale, in
each region
-
applies the dollar format to all cells in the table
-
applies an italic font style for each region and sales
type
-
applies a style (background = red, yellow, or orange) color based
on the SYTLE_PRECEDENCE = option
-
generates ODS HTML output
|
proc format;
value $saletypefmt 'R'='Retail'
'W'='WholeSale';
run; |
|
ods html file="stylePrecedence.html"; |
|
title "Style Precedence";
title2 "First Table: no precedence, Orange ";
title3 "Second Table: style_precedence=page, Yellow"; |
|
proc tabulate data=sales format=dollar10.; |
|
class product region saletype;
|
|
classlev region saletype / style={font_style=italic};
|
|
var netsales; |
|
label netsales="Net Sales";
|
|
keylabel all="Total";
|
|
table product *{style={background=red}},
region*{style={background=yellow}},
saletype*{style={background=orange}}; |
|
table product *{style={background=red}},
region*{style={background=yellow}},
saletype*{style={background=orange}} / style_precedence=page; |
|
format saletype $saletypefmt.;
|
|
run;
ods html close;
|
Copyright © 2010 by SAS Institute Inc., Cary, NC, USA. All rights reserved.