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 (July 2006, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 20 Jul 2006 18:46:46 GMT
Reply-To:     Eric Eyre <eeyre@CONCENTRIC.NET>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Eric Eyre <eeyre@CONCENTRIC.NET>
Organization: Road Runner High Speed Online http://www.rr.com
Subject:      Re: comparison of merge and proc sql
Comments: To: sas-l@uga.edu

Sky

I assume you mean data step match-merge vs. proc sql equi-join (keep it simple)

While both are methods for combining tables horizontally, there are probably as many differences as there are similarities, also it's hard to make specific ironclad riles about which is "better" or "optimum" because frankly many times its a reflection of factors specific to the individual data situation at hand, but that having been said a number of design distinctions exist and are important to know

Sql joins are an implementation of the Cartesian product, the product of 2 sets, the idea conceptually at least is that a join creates a Cartesian product, then eliminates the unneeded rows

Match-merge reflects SAS's own homegrown algorithm for combining data, it's a sequential row-row process with a built-in retain to implement repeated variable values across 1-many relationships

If 2 data sets have1-1 or 1-many matches and lack non-matches on the key value(s), then both the equi-join and the match-merge will produce the same or highly similar results

But if there are many-many matches and/or non-matches on the key, the 2 techniques can produce very different results

The SAS advanced certification training goes into lots of depth about this, also I'm sure there are a ton of previous expositions about this lurking in the sasL archives

Erico

"I guess hanging around is OK, but lurking is right out"

"skyline" <carf4F@gmail.com> wrote in message news:1153387505.938946.22150@b28g2000cwb.googlegroups.com... > Hello, > > I understand that there are two ways of merging data, one uses data > step and the other uses proc sql. What is the exact relation between > these two? > > Thank you very much, >


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