BookmarkSubscribeRSS Feed
Bill
Quartz | Level 8
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;
2 REPLIES 2
Cynthia_sas
SAS Super FREQ
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
Bill
Quartz | Level 8
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;

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 628 views
  • 0 likes
  • 2 in conversation