Date: Mon, 23 Feb 2009 02:17:41 -0500
Reply-To: Haigang Zhou <haigang.zhou@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Haigang Zhou <haigang.zhou@GMAIL.COM>
Subject: Re: merging three files with three key variables
There may be a better method, but the following code should work. Hope it helps.
proc sql;
create table merged as
select a.*, b.aaa, b.bbb, b.ccc, b.ddd, b.eee, c.abc, c.def
from mydata1 as a, mydata2 as b, mydata3 as c
where a.id = b.id = c.id and a.adm = b.adm = c.adm and a.dis = b.dis =
c.dis ;
quit;
Haigang Zhou
|