Hello, I have a dataset showing number of labs received each week for varying number of weeks, where the week numbers will change depending on when the report is run and how far into the past the user chose to look. I want to highlight when volume is unusually high or low for each week. The following program does not work, but is along the lines of what I was trying to do. proc report data=data nowd;
column labname testname flag2 mean std week:;
define LabName / display "Lab Name";
define TestName / display "Test Name";
define flag2 / display ;
define mean/ display ;
define std / display ;
define week: / display;
compute week:;
if week: > (mean + (2*std)) then call define(_col_,"style","style={background=yellow}") /*highlight significant drops in yellow*/;
else if week: < (mean - (2*std)) then call define(_col_,"style","style={background=green}") /*highlight significant increases in green*/;
endcomp;
run; I get the following error: proc report data=data nowd;
2158 column labname testname flag2 mean std week:;
2159 define LabName / display "Lab Name";
2160 define TestName / display "Test Name";
2161 define flag2 / display ;
2162 define mean/ display ;
2163 define std / display ;
2164 define week: / display;
2165
2166 compute week:;
-
22
200
ERROR 22-322: Syntax error, expecting one of the following: ;, /.
ERROR 200-322: The symbol is not recognized and will be ignored.
2167
2168 if week: > (mean + (2*std)) then call define(_col_,"style","style={background=yellow}")
2168! /*highlight significant drops in yellow*/;
2169 else if week: < (mean - (2*std)) then call
2169! define(_col_,"style","style={background=green}") /*highlight significant increases in green*/;
2170
2171 endcomp;
2172
2173 run; Any ideas on how to get this to work? I've considered using a proc format with proc print, but can't figure out how to get the conditional formatting to work.
... View more