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.
Dave
(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)
-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Jim
Groeneveld
Sent: Friday, August 29, 2008 5:42 AM
To: SAS-L@LISTSERV.UGA.EDU
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
records.
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
home.hccnet.nl/jim.groeneveld
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
<gerhard.hellriegel@T-ONLINE.DE> wrote:
>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...)
>
>proc sql;
> create table xx as
> select * from dataset1 a,
> dataset2 b
> where a.id=b.id1 or a.id=b.id2
>quit;
>
>Does that do what you want?
>
>Gerhard
[.........]
Scanned by GenNET AV in
Scanned by GenNET AV out
|