| Date: | Fri, 20 Apr 2001 11:55:26 -0400 |
| Reply-To: | Sigurd Hermansen <hermans1@WESTAT.COM> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | Sigurd Hermansen <hermans1@WESTAT.COM> |
| Subject: | Re: duplicate records |
|
I tried to respond to this question earlier, but my response seems to have
gotten lost in cyberspace.
Unless I am misreading the original question and the responses, it seems to
me that one would have to order the dataset by the original time value prior
to imposing the last.roundedtime condition in a SET BY data step. Few
will find it surprising that a SAS SQL solution seems intuitive to me:
select round(time,1.) as time, code from <dataset>
group by calculated time having time=max(time);
This says what it meams. From each group with the same rounded time value,
select the larger time value. Of course any in a group of one would always
get selected. Sig
|