| Date: | Wed, 5 Jul 2000 12:41:43 -0500 |
| Reply-To: | hcheng@erac.com |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | "H. T. Cheng" <hcheng@ERAC.COM> |
| Subject: | Re: "PROC SQL", "PROC SORT + MERGE" |
| In-Reply-To: | <75ADFA77F338D411B4D900508BCFE7BE42634F@EXCORP01> |
| Content-Type: | text/plain; charset="iso-8859-1" |
Since someone mentioned duplicates, I'd like to bring it to your attention
that Proc SQL and data step MERGE treat m to n match quite differently. You
need to be careful when you have to deal with the situation.
Data A;
id = 1005; x = 1 ; output;
id = 1005; x = 2; output;
run;
data B;
id=1005; y = 10 ; output;
id=1005; y = 20; output;
id=1005; y = 30; output;
run;
How many observations do you expect from the results of proc sql and data
step merge?(assuming that both the sql join and data step merge are based on
the id key variable).
Someone on this L wrote a SUGI paper on this issue and he strongly suggested
using the SQL. I also heard that SAS will make the data step merge the same
as the SQL join.
Regards!
-Harry Cheng
|