Date: Tue, 7 Jun 2005 12:15:32 -0400
Reply-To: "Richard A. DeVenezia" <radevenz@IX.NETCOM.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Richard A. DeVenezia" <radevenz@IX.NETCOM.COM>
Subject: Re: merge more than one table with more than one key
gscsrc@hotmail.com wrote:
> I have 3 tables, table one, two, three.
>
> table one key field is A
> table two key fields are A and B
> table three key fields are A, B and C
>
> how do I join these 3 tables together in one sas data set keep their
> relationships, and do not get duplicates or nulls.
>
Use SQL.
proc sql;
create table _123 as
select distinct three.*, two.*, one.* from
three
left join
two
on three.a=two.a and three.b=two.b
left join
one
on
two.a=one.a
;
--
Richard A. DeVenezia
http://www.devenezia.com/
|