Date: Mon, 9 Feb 2004 09:38:45 +0100
Reply-To: Lars Wahlgren <Lars.WahlgrenRemove@THIS.STAT.LU.SE>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Lars Wahlgren <Lars.WahlgrenRemove@THIS.STAT.LU.SE>
Organization: Lund university
Subject: Re: Picking Common records
or you could use merge in a data step like
data ab ;
merge a (in=a_flag) b (in=b_flag) ;
by id ;
if a_flag & b_flag ;
run ;
hth
/LWn
"Maand M" <maand_n_dune@YAHOO.COM> skrev i meddelandet
news:20040209044651.38587.qmail@web21504.mail.yahoo.com...
> Hi,
> I have different datasets from which I need to pick common records (ie on
common ID variable)
>
> The Data set looks something like this
>
> Dataset a
>
> id var1 var2 var3
> 10 a 4 6
> 12 t 5 9
> 14 p 1 0
> 16 h 5 8
> 17 u 12 6
>
> Dataset b
>
> id var1 var2 var3
> 9 a 5 16
> 11 f 12 8
> 14 p 1 0
> 16 h 5 8
> 21 d 9 9
>
> so the common records will be
>
> id var1 var2 var3
> 14 p 1 0
> 16 h 5 8
>
> Can someone please help me
>
> Thanks
>
> Maand
>
> __________________________________
> Do you Yahoo!?
> Yahoo! Finance: Get your refund fast by filing online.
> http://taxes.yahoo.com/filing.html
|