When you refer to variables under an Across, you need to refer to them by the column position, _Cn_. You can simplify this by using macro logic. Try the following:
%macro loop;
ods listing close;
ods excel file='c:\temp\test.xlsx';
proc report data=sashelp.cars list spanrows;
title "This is a complete report";
columns ("World Vehicle" origin make) drivetrain ,(msrp invoice) dummy;
format msrp invoice dollar18.2;
define Origin / group center;
define Make / group left;
define DriveTrain / across left;
define dummy / computed noprint;
break after origin / summarize style=[fontweight=bold];
compute dummy;
%do i=3 %to 8;
if _c&i._ > 100000 then
call define("_c&i._", "style", "style={backgroundcolor=yellow}");
if _c&i._ > 1000000 then
call define("_c&i._", "style/merge", "style={foreground=red}");
%end;
endcomp;
compute after origin;
line " ";
endcomp;
run;
ods excel close;
ods listing;
title;
%mend;
%loop
... View more