|
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.
|