LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (April 2001, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
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
Comments:   To: karen.olson@TCH.HARVARD.EDU

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


Back to: Top of message | Previous page | Main SAS-L page