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 (May 2001, week 5)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 31 May 2001 16:59:48 -0400
Reply-To:     "Muhlbaier, Lawrence H." <lawrence.muhlbaier@DUKE.EDU>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "Muhlbaier, Lawrence H." <lawrence.muhlbaier@DUKE.EDU>
Organization: Duke Clinical Research Institute
Subject:      Re: merge replacement
Content-Type: text/plain; charset=us-ascii

Both Harry Droogendyk and James Brittain's suggestions have sorts implied in them. The SQL code does a sort in the work space as it goes and the INDEX building process is in fact a tagsort with just the sorted variable and key stored in the index.

I think that you are pretty much stuck. You could write data step code to do a binary search and link that way, but why (it passes the datasets multiple times, probably more often than a sort would). If you are worried about sort disk space, using the tagsort option on the sort will minimize disk space.

Doc

wendy.watson@COVANCE.COM wrote:

> Hi SAS-L, > > I have two very large datasets and would like to attach variables from one > dataset to the other without a sort and merge. > Data 1 has the variables SSN, DRUG, etc. Data 2 has the variables SSN and > DATE OF BIRTH. I would like to attach DATE OF BIRTH from Data 2 to Data 1 > (the merge variable would be SSN). Data 1 contains one record for each SSN > and Data 2 has one record per SSN containing their Date of Birth. Any > ideas? > > Also, If Data 1 had multiple records for each SSN, how would I attach DOB > from DATA 2 in this scenario? Thanks. > > Data 1 Data 2 > > SSN DRUG SSN DOB > > SSN02 X SSN03 12/04/1973 > SSN01 Y SSN02 09/18/1951 > SSN03 X SSN01 05/15/1987 > ... > -OR- > > Data 1 Data 2 > > SSN DRUG SSN DOB > > SSN02 X SSN03 12/04/1973 > SSN01 Y SSN02 09/18/1951 > SSN03 X SSN01 05/15/1987 > SSN02 Z > SSN01 D > SSN03 C > ... > > ----------------------------------------------------- > Confidentiality Notice: This e-mail transmission > may contain confidential or legally privileged > information that is intended only for the individual > or entity named in the e-mail address. If you are not > the intended recipient, you are hereby notified that > any disclosure, copying, distribution, or reliance > upon the contents of this e-mail is strictly prohibited. > > If you have received this e-mail transmission in error, > please reply to the sender, so that we can arrange > for proper delivery, and then please delete the message > from your inbox. Thank you.

-- Lawrence H. ('Doc') Muhlbaier muhlb001@mc.duke.edu Assistant Research Professor Duke University Medical Center 919-668-8774 (office) DUMC 3865 919-383-0595 (home) Durham, NC 27710-7510 919-668-7057 (FAX)


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