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 2011, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Fri, 4 Mar 2011 11:23:05 -0500
Reply-To:     bbser 2009 <bbser2009@GMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         bbser 2009 <bbser2009@GMAIL.COM>
Subject:      Re: Confusing Dedup code
Comments: To: Irin later <irinfigvam@YAHOO.COM>
In-Reply-To:  <67231.5104.qm@web39424.mail.mud.yahoo.com>
Content-Type: text/plain; charset="utf-8"

Irin

It seems to me that you always want the smallest timeframe for the same ID regardless of values of tag1 and tag2. Did I misunderstand anything?

Thanks. -Max

-----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Irin later Sent: March-04-11 10:57 AM To: SAS-L@LISTSERV.UGA.EDU Subject: [SAS-L] Confusing Dedup code

I am confused with a dedup codeā€¦.. -Among the patients with the same ID and criteria tag1=1, one needs first to keep from records with tag1=1 and with the shortest timeframe between Disch_date and srv_date that follows the hospital discharge. This is the 1st I priority for dedup. -In case tag1=0, the priority would be tag2=1 with the shortest timeframe -In case both tag1=0 and tag2=0 one needs to keep the record with the shortest timeframe

for example: Scenarion #1: id srv_date disch_date timeframe tag1 tag2 12a 07/15/2010 07/05/2010 10 1 1 12a 08/31/2010 08/01/2010 30 0 1 12a 03/10/2010 02/16/2010 24 0 1 12a 06/24/2010 06/10/2010 14 1 1 12a 05/30/2010 03/30/2010 60 0 0 12a 09/25/2010 09/05/2010 20 0 1 I need the following record with tag1=1 and with the shortest timeframe=10 (rather than timeframe=14) id SRV_date disch_date timeFrame tag1 tag2 12a 07/15/2010 07/05/2010 10 1 1

Scenario #2: id srv_date disch_date timeFrame tag1 tag2 12a 08/31/2010 08/01/2010 30 0 1 12a 03/10/2010 02/16/2010 24 0 1 12a 05/30/2010 03/30/2010 60 0 0 12a 09/25/2010 09/05/2010 20 0 1 I need the following record with tag2=1 and the shortest timeframe=20 (rather than timeframe=24 or 30) id srv_date disch_date timeFrame tag1 tag2 12a 09/25/2010 09/05/2010 20 0 1

Scenario #3 (both tag1 and tag2 =0): id srv_date disch_date timeFrame tag1 tag2 12a 09/31/2010 08/01/2010 60 0 0 12a 03/14/2010 02/10/2010 34 0 0 12a 05/30/2010 03/25/2010 55 0 0 12a 10/25/2010 09/15/2010 40 0 0 I need the following record the shortest timeframe=34 id srv_date disch_date timeFrame tag1 tag2 12a 03/14/2010 02/10/2010 34 0 0

Could you, please, give me a hand?

Thank you for advance,

Irin


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