LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (December 2006, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Wed, 13 Dec 2006 09:45:56 -0800
Reply-To:   rss <rslotpole@FMR.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   rss <rslotpole@FMR.COM>
Organization:   http://groups.google.com
Subject:   Re: setting cell color on basis of variable value
Comments:   To: sas-l@uga.edu
In-Reply-To:   <1166029597.337884.56660@80g2000cwy.googlegroups.com>
Content-Type:   text/plain; charset="us-ascii"

rss wrote: > Hi, > > I have the following code: > > ods listing close; > proc template; > define style styles.XLStatistical; > parent = styles.Statistical; > > replace HeadersandFooters/ > background=mediumblue FOREGROUND=white; > > style Header from Header/ > borderwidth=2; > style RowHeader FROM ROWHEADER/ > borderwidth=2; > style Data from Data / > borderwidth=2; > end; > run; quit; > > > %let _ODSSTYLE=XLStatistical; > %let _ODSDEST=tagsets.MSOffice2K; > run; > > ods &_ODSDEST path='c:\sas\excel' file='ExcelXP-sample01.htm' > style=&_ODSSTYLE; > > options pagesize=80; > title1 'SAI mean return of ranks'; > proc tabulate data=ar.rank17 noseps order=internal ; > > class yy mm; > > var df1_5 df1_4 df2_5 df2_4; > > > table(mm ='' all='Month Avg.'), > (yy='Information Coefficient' all='Ann. Avg.') > > *(df1_5 df1_4 df2_5 df2_4) *mean='' *f=comma5.3 /rts=12 box > = 'YEAR' condense misstext='*'; > run; > > > I need to highlight by either changing the font color or changing the > cell background color whenever the variable (df1_5, df1_4, df2_5,df2_4) > is negative. Can I do that in proc tabulate or do I need to go to proc > report? Would I adjust the template or is there a way to set the stype > with tabulate?

I've tried the following but it's obvious that I don't understand what's going on:

proc format; value pnf 0-100='1' -100 - -.000001='-1' ; value col 1='white' -1='red' ; run;

ods listing close;

%let _ODSSTYLE=XLStatistical; %let _ODSDEST=tagsets.MSOffice2K;

ods &_ODSDEST path='c:\sas\excel' file='ExcelXP-sample01.htm' style=&_ODSSTYLE;

options pagesize=80; title1 'SAI difference in mean return'; proc tabulate data=ar.rank17 noseps order=internal ; style={background=col.}; class yy mm; var df1_5 df1_4 df2_5 df2_4;

table(mm ='' all='Month Avg.'), (yy='Information Coefficient' all='Ann. Avg.')

*(df1_5 df1_4 df2_5 df2_4) *mean='' *f=comma5.3 /rts=12 box = 'YEAR' condense misstext='*'; format df1_5 df1_4 df2_5 df2_5 pnf.; run; The style = statement is crashing with STATEMENT IS NOT VALID.


Back to: Top of message | Previous page | Main SAS-L page