Date: Thu, 24 Sep 2009 13:51:55 -0400
Reply-To: Norm Weston <nweston@AMGEN.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Norm Weston <nweston@AMGEN.COM>
Subject: Re: last date of contact
I am sure that there will be several ways of doing this. Personally, I
would transpose the dataset and then sort in order by your date field(s).
Then you could rename or create a new field based on that. Something like
this;
proc sort data=have;
by header-vars;
run;
proc transpose data=have out=trans;
by header-vars;
var date vars;
run;
proc sort data=trans;
by header-vars and new-date-val;
run;
data last_contact;
set trans;
by header-vars;
if last.header-vars then output;
run;
From there you can stack them back, or do whatever you were planning on
doing with the data (i.e. retranspose back and attach, or whatever).