Hi:
Without seeing ALL of your code, it is hard to comment. There are a few things that are possibilities
1) PROC REPORT left/right issues or
2) COMPOUND name issues
1)
... PROC REPORT works from LEFT to RIGHT. So if you have this:
[pre]
column something fytd color something2;
[/pre]
...then proc report will not know about COLOR when it is creating the report column for FYTD. But if you have this:
[pre]
column something color fytd something2;
[/pre]
...then PROC REPORT will have placed COLOR on the report row before it goes to execute the COMPUTE block for FYTD.
You cannot use COLOR in the COMPUTE block for FYTD unless COLOR is available for use. Remember that PROC REPORT does not have a Program Data Vector (like the DATA step) -- so in the above column statement, when PROC REPORT is placing the variable SOMETHING on the report row, it has NO visibility of the values for COLOR, FYTD or SOMETHING2. When PROC REPORT is placing COLOR on the report row, it has no visibility of FYTD values.
2)
Also, you might be having an issue with this:
[pre]
define color / NOPRINT DISPLAY ANALYSIS;
[/pre]
DISPLAY and ANALYSIS are conflicting usages. DISPLAY means the variable will not be summarized on a BREAK or RBREAK line. Then when you turn around and give a usage of ANALYSIS, you are telling PROC REPORT that you changed you mind and COLOR will be used for ANALYSIS and the default statistic should be the SUM statistic. If you are seeing messages like:
[pre]
NOTE: Variable color is uninitialized.
[/pre]
This would be an indication that PROC REPORT is expecting you to use the compound reference: COLOR.SUM ... because the last usage for COLOR was the ANALYSIS usage. If you want to use the simple reference name of COLOR, then keep only the usage of DISPLAY. If you want to use the compound reference for COLOR, then keep only the usage of ANALYSIS.
But without seeing more of your code, or your LOG with error messages, it's hard to say. The code below worked for me. Consider the code below. The trafficlighting for AGE and HEIGHT work, however, the trafficlighting for NAME does not work because of the LEFT-to-RIGHT workings of PROC REPORT.
cynthia
[pre]
data class;
set sashelp.class(obs=3);
color = _n_;
run;
ods html file='c:\temp\tlite.html' style=sasweb;
proc report data=class nowd;
column name color sex age height;
define name / order;
define color / display noprint;
define sex / display noprint;
define age / display;
define height / display;
compute name;
** this will NOT work;
IF COLOR=1 THEN CALL DEFINE (_COL_,'style','style={background=light green}');
IF COLOR=3 THEN CALL DEFINE (_COL_,'style','style={background=pink}');
IF COLOR=2 THEN CALL DEFINE (_COL_,'style','style={background=light gray}');
ENDCOMP;
compute age;
** this WILL work;
IF COLOR=1 THEN CALL DEFINE (_COL_,'style','style={background=light green}');
IF COLOR=3 THEN CALL DEFINE (_COL_,'style','style={background=pink}');
IF COLOR=2 THEN CALL DEFINE (_COL_,'style','style={background=light gray}');
ENDCOMP;
compute height;
if name = 'Alfred' and sex = 'M' then
call define(_col_,'style','style={foreground=cyan}');
endcomp;
run;
ods html close;
[/pre]