Date: Tue, 3 Mar 2009 15:43:49 -0600
Reply-To: Joe Matise <snoopy369@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Joe Matise <snoopy369@GMAIL.COM>
Subject: Re: Question on Proc Report: how to change row color upon a
change in ID?
In-Reply-To: <018a01c99c46$a4f42fc0$832fa8c0@HP82083701405>
Content-Type: text/plain; charset=ISO-8859-1
You certainly could pre-calculate a variable in a data step using first.id:
data want;
retain idcolor;
set have;
by id;
if missing(idcolor) then idcolor=1;
else if first.id and idcolor=1 then idcolor = 2;
else if first.id and idcolor=2 then idcolor=1;
run;
and then use that in a COMPUTE block
compute <var>
if idcolor = 1then do;
call define(_row_,"style","style=[background=cxFFFF00]");
end;
else if idcolor=2 then
call define(_row_,"style","style=[background=cx0000FF]");
endcomp;
I imagine you can do it entirely within proc report but I'm still a newbie
at that so I don't know the answer directly.
-Joe
On Tue, Mar 3, 2009 at 3:25 PM, Mary <mlhoward@avalon.net> wrote:
> Is there a way in Proc report to change the row color
> upon a change in ID? I've got a report with ID, Visit,
> and some other variables, and would like to block
> each ID by alternating colors upon a change in ID,
> not just a change in row, such as light blue, light yellow;
> I have a varying number of visits per patient, such as 1-15.
>
> -Mary
>
|