Elayne:
One way to insert a "placeholder" column is to use a compute block to set the value for a computed column that is just 1 space. This is shown below in a modification to Chevell's example using variables bl1 and bl2. Once you have introduced the placeholder or blank columns into the output, you could use the ExcelXP method for changing the column width.
As for your requirement to test a column value, consider another modification to Chevell's code, shown below. Note how the background value for the height or weight column is set using the _col_ attribute. There are a lot of different ways you could do this kind of highlighting. It is possible to set the value of a column based on the value of another column...but since proc report builds the report row from left to right, you may have to experiment a bit with the logic of your compute blocks to get things to highlight correctly.
cynthia
[pre]
*** sas code;
ods listing close;
ods tagsets.excelxp file="c:\temp\temp1.xls";
proc report data=sashelp.class nowd;
column age bl1 sex bl2 height weight;
define age / order;
define bl1 / computed ' ';
define sex / order;
define height / analysis mean "Avg Ht";
define bl2 / computed ' ';
define weight / analysis mean "Avg Wt";
compute bl1 / character length=1;
bl1 = ' ';
endcomp;
compute bl2 / character length=1;
bl2 = ' ';
endcomp;
compute age;
count+1;
if count in(6,7,8) then do;
call define(_row_,"style",
"style={background=red}");
end;
else if count in(16,17,18) then do;
call define(_row_,"style",
"style={background=blue}");
end;
endcomp;
compute height;
if height.mean = 59 then
call define(_col_,"style",
"style={background=pink}");
endcomp;
compute weight;
if weight.mean le 99 then
call define(_col_,"style",
"style={background=cyan}");
else if weight.mean gt 110 then
call define(_col_,"style",
"style={background=beige}");
endcomp;
compute before age;
line " ";
endcomp;
run;
ods tagsets.excelxp close;
[/pre]
... View more