Date: Thu, 5 Aug 2004 11:24:25 -0700
Reply-To: "Terjeson, Mark" <TERJEM@DSHS.WA.GOV>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Terjeson, Mark" <TERJEM@DSHS.WA.GOV>
Content-Type: text/plain
Hi David,
Here's one method:
data one;
input profile $ d1 $ d2 $ d3 $;
cards;
Profile1 data1 data2 data3
Profile1 data4 data5 data6
Profile2 data1 data2 data3
Profile3 data1 data2 data3
Profile4 data1 data2 data3
Profile4 data4 data5 data6
;
run;
data two;
input profile $ name $;
cards;
Profile1 Name1
Profile1 Name2
Profile1 Name3
Profile2 Name1
Profile2 Name2
Profile3 Name1
Profile3 Name2
Profile3 Name3
Profile4 Name1
Profile4 Name2
;
run;
proc sql;
create table result as
select
b.*,
a.*
from
one as a,
two as b
where
a.profile eq b.profile
order by
a.profile,
a.d1,
a.d2,
a.d3,
b.name
;
quit;
Hope this is helpful,
Mark Terjeson
Reporting, Analysis, and Procurement Section
Information Services Division
Department of Social and Health Services
State of Washington
mailto:terjem@dshs.wa.gov
-----Original Message-----
From: David W Neylon [mailto:David.W.Neylon@WELLSFARGO.COM]
Sent: Thursday, August 05, 2004 10:43 AM
To: SAS-L@LISTSERV.UGA.EDU
Subject:
I'm having a problem to seems to be well beyond my SAS knowledge. I have
two SAS files that I want to merge, but I guess you would call it a many to
many merge.
The data looks like this.
Profile1 data1 data2 data3 Profile1 Name1
Profile1 data4 data5 data6 Profile1 Name2
Profile2 data1 data2 data3 Profile1 Name3
Profile3 data1 data2 data3 Profile2 Name1
Profile4 data1 data2 data3 Profile2 Name2
Profile4 data4 data5 data6 Profile3 Name1
Profile3 Name2
Profile3 Name3
Profile4 Name1
Profile4 Name2
And I want to get a single file that looks like:
Profile1 Name1 data1 data2 data3
Profile1 Name2 data1 data2 data3
Profile1 Name3 data1 data2 data3
Profile1 Name1 data4 data5 data6
Profile1 Name2 data4 data5 data6
Profile1 Name3 data4 data5 data6
Profile2 Name1 data1 data2 data3
Profile2 Name2 data1 data2 data3
Profile3 Name1 data1 data2 data3
Profile3 Name2 data1 data2 data3
Profile3 Name3 data1 data2 data3
Profile4 Name1 data1 data2 data3
Profile4 Name2 data1 data2 data3
Profile4 Name1 data4 data5 data6
Profile4 Name2 data4 data5 data6
If this makes sense to anyone could you please give me a way to do this?
Thank you,
David W Neylon, Sr
Consultant/Data Security Analyst
Corporate Information Security - CIS
Mainframe Security Technical Services
(480) 774-3155
David.W.Neylon@WellsFargo.com
Wells Fargo Confidential
This message may contain confidential and/or privileged information. If you
are not the addressee or authorized to receive this for the addressee, you
must not use, copy, disclose, or take any action based on this message or
any information herein. If you have received this message in error, please
advise the sender immediately by reply e-mail and delete this message. Thank
you for your cooperation.