Try this. By default numeric variables such as "weight" are analysis variables and so have statistics associated with them. In a compute block you would refer to the statistic. For example "weight.sum". In this case, however, you don't want statistics, you just want to display the value, so you should specify "weight" as a display variable. proc report data=sashelp.class nowd; column name weight; define name--weight / display; compute before; maxweight = 0; endcomp; compute weight; if weight < maxweight then do; call define('Weight','style','style={background=green}'); end; else do; if weight > maxweight then do; call define('Weight','style','style={background=yellow}'); maxweight = weight; end; end; endcomp; run;
... View more