Hello,
Basically I'm trying to color column cell using value of other column.
I would like to have all values of COL2 displayed colored where COL1='A'.
However, with following code only first value of COL2 where COL1='A' is being displayed colored.
Please suggest!!
Thanks!!
data test1;
input COL1 $1. COL2 $5. NUM1;
datalines;
A rx1 2
A rx2 1
B rx1 1
B rx2 2
B rx2 5
B rx3 3
run;
ods pdf file="C:\test.pdf" notoc /*style=mystyle*/ uniform;
proc report data=test1 nofs nocenter headline headskip split="/" /*spanrows*/;
column col1 col2 num1;
define col1 / group;
define col2 / group;
define num1 / analysis sum;
compute col2;
if col1='A' then
call define(_col_, "style", "STYLE=[BACKGROUND=cxFFFF82]");
endcomp;
run;
ods pdf close;
You need to "remember" the value of col1.
You need to "remember" the value of col1.
Excellnt, this works!
Thanks!!
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.