Below is my dummy code. I expected Variable A to be highlighted yellow in the same pattern as Variable B, but instead the whole column is yellow. I've switched the order of the compute blocks but get the same results. data mydata;
input ID $ VarA VarB;
datalines;
A 10 10
B 20 25
C 30 30
D 40 35
;
run;
proc report data=mydata;
columns ID VarA VarB;
define ID / display;
define VarA / display 'Variable A';
define VarB / display 'Variable B';
compute VarA;
if VarB ne VarA then do;
call define(_col_, "style", "style={background=yellow}");
end;
endcomp;
compute VarB;
if VarB ne VarA then do;
call define(_col_, "style", "style={background=lightred}");
end;
endcomp;
run; ... yields the following output. Why is this?
... View more