The timing and execution of the compute blocks can be quite different based on the association of report items. In this scenario you may want the compute block to execute when the proc report processes the COUNT column. There are some good papers that go into quite a bit of detail to explain the sequence of compute blocks. From memory they work from left to right in order of columns (not by the order of your compute block codes). Once I adjusted the compute block to execute when processing the COUNT column the issue with the IN operator is corrected. You could combine the LINE compute block with the COUNT compute block since LINE column would already be processed by this stage. proc report data=LINED nowd out=t;
column ROW LINE COL,(VALUE COUNT);
define ROW /group;
define LINE /group noprint;
define COL /across ' ';
define VALUE /display ;
define COUNT /analysis '#' ;
/* compute LINE;*/
/* if LINE > 1 then call define(_row_,"style","style={background=cxEEFFFF}");*/
/* endcomp;*/
compute COUNT;
if LINE > 1 then call define(_row_,"style","style={background=cxEEFFFF}");
* 3rd line is blue as intended;
* if _C4_ = 2 then call define(_row_,"style","style={background=cxEEFFFF}");
* 1st line is blue as intended;
* if _C4_ = 1 then call define(_row_,"style","style={background=cxEEFFFF}");
* all lines are blue! not intended ! ;
* Corrected by adjusting the COMPUTE block to execute when processing of COUNT;
if _C4_ ^in (1,2) then call define(_row_,"style","style={background=cxEEFFFF}");
endcomp;
run;
... View more