The SAS Output Delivery System and reporting techniques

Proc Tabulate All Font_Weight

Reply
Super Contributor
Posts: 291

Proc Tabulate All Font_Weight

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;
SAS Super FREQ
Posts: 8,742

Re: Proc Tabulate All Font_Weight

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
Super Contributor
Posts: 291

Re: Proc Tabulate All Font_Weight

Thank you. I have a way to run this in V9, so I'll go there.
Ask a Question
Discussion stats
  • 2 replies
  • 179 views
  • 0 likes
  • 2 in conversation