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 (June 2005, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
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
Comments: To: sas-l@uga.edu

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/


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