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 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
Comments:   To: sas-l@uga.edu
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.


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