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
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,
>