Date: Tue, 9 Jun 2009 09:56:11 +0800
Reply-To: shao xiaolong <sxlion2@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: shao xiaolong <sxlion2@GMAIL.COM>
Subject: Re: First and Last Observation
In-Reply-To: <200906082336.n58NVfiK003158@malibu.cc.uga.edu>
Content-Type: text/plain; charset=ISO-8859-1
I don't think you can avoid the second sort.
the fellowing only reduce a data step,
proc sort data =have ; by ID1 Date time ID2 ID3 ; run;
proc sort data =have ; by ID1 Date ID2 ID3 ; run;
data last ;
set have;
by ID1 date ID2 ID3 ;
FO = first.ID3 ;
LO = last.ID3 ;
run;
|