| Date: | Thu, 20 Jul 2006 12:44:18 -0700 |
| Reply-To: | BK <byronkirby@GMAIL.COM> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | BK <byronkirby@GMAIL.COM> |
| Organization: | http://groups.google.com |
| Subject: | Re: comparison of merge and proc sql |
|
| Content-Type: | text/plain; charset="iso-8859-1" |
|---|
To build on Eric's comment,
SQL joins give you a bit more flexibility in joining datasets but are
more limited in the operations that can be preformed at the time of
execution.
One word of advice, in most situations a DATA step is sufficient for
merging datasets using "BY" and "IN=" statements/options, and the logs
gives you valuable information about what has happened in the datastep.
However, with SQL the log is of very little help, it assumes that you
know exactly what you wanted and coded it as such. So, be VERY careful
to make sure that you know if/when you are dealing with Multi-to-Multi
joins.
My rule of thumb is if I'm just joining two sets, I use SQL; it's
usually faster and requires no sorting. If I need manipulate the
records, I'll usually use a DATA step as it's got a bit more
flexibility, not to mention the increased readability.
|