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 (March 2008, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 12 Mar 2008 07:17:32 -0700
Reply-To:     chao <soulas.gaetan@NEUF.FR>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         chao <soulas.gaetan@NEUF.FR>
Organization: http://groups.google.com
Subject:      Re: Coding question, please help!
Comments: To: sas-l@uga.edu
Content-Type: text/plain; charset=ISO-8859-1

On Mar 12, 2:41 pm, Xuhong <zhuxuhong2...@gmail.com> wrote: > Hello, folks, > > I have one problem and am stucked at a certain point. If somebody > could give me a hint, it will be great. Thanks. > The dataset has been sorted by member_ID and Service_date. And what I > want is to delete those dates that are within 10 days and only keep > the first one. I simplified the dataset as following. > > /***input ***/ > member_ID Service_date > 12345 09/29/2004 > 12345 10/01/2004 > 12345 10/03/2004 > 12345 10/01/2005 > 12345 10/03/2005 > 52132 06/07/2003 > 55225 05/13/2004 > 55225 05/18/2004 > 55225 03/11/2005 > > /**Desired output***/ > 12345 09/29/2004 > 12345 10/01/2005 > 52132 06/07/2003 > 55225 05/13/2004 > 55225 03/11/2005

Hello,

I hope I can help you with this code :

data table2 (drop = date1); set table1; retain date1; if _n_ = 1 or Service_date - date1 > 10 then do;output; date1 = service_date; end; run;

Is that OK ?

Gaétan


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