Help using Base SAS procedures

Proc Tabulate with Shaded Columns

Reply
Occasional Contributor PSR
Occasional Contributor
Posts: 6

Proc Tabulate with Shaded Columns

Hi ,

anybody having idea about how to get alternate shaded rows in proc tabulate.
Super Contributor
Posts: 291

Re: Proc Tabulate with Shaded Columns

I don't know about alternate columns necessarily, but here's what I used to shade specific columns. For readability, every third or even fourth column is actually quite sufficient.

First, build a colour format with something like

Proc format:
value $bkgrnd
"Lvl1','Lvl2','Lvl3'='cxf6f5ea'
other='cxffffff';
run;

Then in proc tabulate, under the ODS umbrella, apply the $bkgrnd format to the class variable that contains the values of Lvl1, Lvl2,Lvl3,... with
classlev LvlVarname/style=[background=$bkgrnd.];

Not my invention, I think Cynthia helped me through this one. You should be able to find more in the archives in the ODS section.

Hope this helps at least a little bit!
SAS Super FREQ
Posts: 8,861

Re: Proc Tabulate with Shaded Columns

Hi:
To achieve banding (differing row colors) in Proc Tabulate, where the whole -row- is colored (not just the class level values), you need to investigate the use of the <parent> syntax in proc tabulate for making style changes.

Here's an output example:
http://support.sas.com/kb/25/addl/fusion25401_1_odstab10.htm

Here's the Tech Support note with the code (second to last example):
http://support.sas.com/kb/25/401.html

There's another example, in my paper, here:
http://www2.sas.com/proceedings/forum2008/173-2008.pdf

And the programs for that paper are downloadable from:
http://support.sas.com/rnd/papers/sgf2008/complex_reports.zip

cynthia
Ask a Question
Discussion stats
  • 2 replies
  • 413 views
  • 0 likes
  • 3 in conversation