The SAS Output Delivery System and reporting techniques

Highlighting "ALL" in Tabulate

Reply
Super Contributor
Posts: 291

Highlighting "ALL" in Tabulate

Have the following code. I don't understand why the 'ALL' column values are not getting the blue background requested by the style statement adjacent to the ALL. Ultimately, I'd like to apply the background to all ALLs. Some help would be appreciated - Thanks


proc tabulate data=SlitLoss2 format=6.1 style=[font_face=helvetica font_size=9pt];
format WeekOf date7. Op_No Op_Cd.;
class op_no grd_cd WeekOf/style=[foreground=gray font_face=helvetica font_size=9pt];
classlev op_no WeekOf/style=[foreground=gray font_face=helvetica font_size=9pt];
classlev grd_cd /style=[foreground=black font_face=helvetica font_size=10pt];
var EdgeWtLoss/style=[foreground=gray font_face=helvetica font_size=9pt];
table (op_no=' ' all*[style=[background=blue foreground=black font_weight=bold font_size=9pt]]) *
(WeekOf='Week Of' all),
(Grd_Cd='Steel Grade' all) *
EdgeWtLoss=' Weight Loss ' *sum='' *[style=[foreground=black font_face=helvetica font_size=11pt]]
/condense misstext=' ';
run;
SAS Super FREQ
Posts: 8,865

Re: Highlighting "ALL" in Tabulate

Hi:
You might try
[pre]
table row_dim,
col_dim / style_precedence=row;
[/pre]

STYLE_PRECEDENCE and FORMAT_PRECEDENCE were new options added to TABULATE in SAS 9. You can specify which format or which style specification should control cells. If you want to apply the same style characteristics to all of the ALL cells -- not just those in the rows, then you may choose to specify your style specification in the KEYWORD statement. The PROC TABULATE doc has a sample program entitled:
Specifying Style Elements for ODS Output (example 14) that illustrates using the KEYWORD statement
and a sample program entitled:
Style Precedence (example 15) that illustrates style_precedence.

cynthia
Super Contributor
Posts: 291

Re: Highlighting "ALL" in Tabulate

Posted in reply to Cynthia_sas
I ended up using the following code:

proc tabulate data=SlitLoss2 format=6.1 style=[foreground=black font_face=helvetica font_size=11pt];
format WeekOf date7. Op_No Op_Cd.;
class op_no grd_cd WeekOf/style=[foreground=gray font_face=helvetica font_size=9pt];
classlev op_no WeekOf /style=[foreground=gray font_face=helvetica font_size=9pt];
classlev grd_cd /style=[foreground=black font_face=helvetica font_size=10pt];
keyword all /style=[foreground=black background=cxf6f5ea font_weight=bold font_style=italic font_size=10pt];
var EdgeWtLoss /style=[foreground=gray font_face=helvetica font_size=9pt];
table (op_no=' ' all) *
(WeekOf='Week Of' all* [style=[foreground=black background=cxf6f5ea font_weight=bold font_style=italic font_size=10pt]]),
(Grd_Cd='Steel Grade' all *[style=[foreground=black background=cxf6f5ea font_weight=bold font_style=italic font_size=10pt]]) *
EdgeWtLoss=' Weight Loss ' * sum=''
/condense misstext=' ';
run;
Ask a Question
Discussion stats
  • 2 replies
  • 128 views
  • 0 likes
  • 2 in conversation