BookmarkSubscribeRSS Feed
Bill
Quartz | Level 8
Have code as noted below and would like to have the "all" data in bold as indicated by the style statement ((SLAB_GRD_FAM_NAME=' ' all) all*[style=[font_weight=bold]],
), but it has no effect. I think that it's being overridden by the subsequent style statement.What's the remedy please? (Using v8.2) Thank you for your help.

proc tabulate data=SlabIm2 format=comma6.0 style=[font_face=helvetica font_size=8pt];

where PROD_GRP_DIM_CD='Prime';

class InvenDate
SLAB_GRD_FAM_NAME
SLAB_SOURCE_DIM_CD
APPL_FLG
SLAB_AGE_CATR_NAME;

classlev InvenDate
SLAB_SOURCE_DIM_CD
APPL_FLG
SLAB_AGE_CATR_NAME/style=[foreground=gray font_face=helvetica font_size=7pt];

classlev Slab_Grd_Fam_Name/style=[foreground=gray font_face=helvetica font_size=6pt];

var SLAB_TON/style=[foreground=gray font_face=helvetica font_size=7pt];
format Appl_Flg $AppFlg. InvenDate date7.;

table SLAB_SOURCE_DIM_CD=' '*
(SLAB_GRD_FAM_NAME=' ' all) all*[style=[font_weight=bold]],
InvenDate=''*
(APPL_FLG=' ' SLAB_AGE_CATR_NAME=' ')
*SLAB_TON=' '*sum=' '*
[style=[foreground=black font_face=helvetica font_size=8pt]]
/misstext=' '
box=[label="Prime Tons Only"
style=[foreground=black font_face=helvetica font_size=10pt]]
;
run;
2 REPLIES 2
Cynthia_sas
SAS Super FREQ
Hi:
The rule of thumb for Tabulate in SAS 8.2 is that "Column wins" -- in the setting of formats and in the setting of style. So you are exactly right....what is specified in the column dimension is clobbering what is specified in the row dimension.

In SAS 9, two new options were added to Tabulate that allowed you to set which dimension "wins" in the setting of format and style. Those options are:
[pre]
table page_dim,
row_dim,
col_dim / style_precedence=row format_precedence= row;
[/pre]

STYLE_PRECEDENCE and/or FORMAT_PRECEDENCE changes the default behavior. The values can be either PAGE, ROW or COL.

I'm not sure there ever was a workaround for this in SAS 8.2 -- you might consider doing the report with PROC REPORT, because the equivalent of the ALL lines in Tabulate would be written with either the BREAK or the RBREAK statements and in Proc Report, you can have multiple variables nested as ACROSS variables and have multiple variables nested as GROUP variables and then the summary highlighting can be applied just to the summary lines, as shown in the code below:
[pre]
ods html file='c:\temp\report_across_style.html'
style=sasweb;
proc report data=sashelp.prdsale nowd
style(summary)={font_weight=bold};
title 'PROC REPORT Nested Vars Across and STYLE overrides';
column ('Country' country)('Region' Region)
prodtype,division,actual
('Grand Total' actual=gtot);
define country / group ' ';
define region / group ' ';
define prodtype / across;
define division / across ' ';
define actual / sum ' ';
define gtot / sum ' '
style(column)={font_weight=bold};
rbreak after / summarize;
break after country /summarize;
compute after country;
line ' ';
endcomp;
compute after;
Country = 'Total';
endcomp;
run;
ods html close;
[/pre]

cynthia
Bill
Quartz | Level 8
Thank you. I have a way to run this in V9, so I'll go there.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 918 views
  • 0 likes
  • 2 in conversation