Date: Fri, 29 Aug 2008 10:44:41 -0400
Reply-To: "Treder, David" <dtreder@GENESEEISD.ORG>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Treder, David" <dtreder@GENESEEISD.ORG>
Subject: FW: Re: merging on a 2ndary var, when no primary var match
Content-Type: text/plain; charset="us-ascii"
Thanks to all for the suggestions/solutions - I don't think it's said
enough what an unbelievably awesomely helpful listserv this is.
(I had thought of the different scenarios - at times I want to include
unmatched and/or missing, other times not. The suggestions provided
give me options to do this)
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Jim
Sent: Friday, August 29, 2008 5:42 AM
Subject: Re: merging on a 2ndary var, when no primary var match
Good solution Gerhard,
but shouldn't you exclude missing values while matching on ID1 and ID2?
If neither ones match those unmatched records get lost.
With the strategy that I proposed they are not lost but can be flagged.
It depends on what the initial poster wants with those unmatched
Are there any at all?
And are there records with MISSINGs for both ID1 and ID2?
I doubt whether the questioning poster was aware of all scenarios.
Regards - Jim.
Jim Groeneveld, Netherlands
Statistician, SAS consultant
My computer doesn't know yet but I will attend PhUSE 2008 in Manchester.
On Fri, 29 Aug 2008 05:18:46 -0400, Gerhard Hellriegel
>I didn't try that, but what about a SQL join with
>where a.id=b.id1 or a.id=b.id2
>The whole (from mind, so no guarantee...)
> create table xx as
> select * from dataset1 a,
> dataset2 b
> where a.id=b.id1 or a.id=b.id2
>Does that do what you want?
Scanned by GenNET AV in
Scanned by GenNET AV out