Date: Mon, 1 Feb 2010 13:04:51 -0600
Reply-To: Joe Matise <snoopy369@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Joe Matise <snoopy369@GMAIL.COM>
Subject: Re: sas merge issues
In-Reply-To: <91ccd023-c42e-4384-8ec6-ba312d8a1c2f@n33g2000yqb.googlegroups.com>
Content-Type: text/plain; charset=ISO-8859-1
By var1 var2 var3 var4;
if first.var4 and last.var4;
-Joe
On Mon, Feb 1, 2010 at 12:17 PM, Ram <naveennitchel@gmail.com> wrote:
> There is no unique record id. The unique keys are "4 vars" . How do I
> change the first.var and last.var using 4 variables?
>
> Thanks,
> Ram
>
> On Feb 1, 11:26 am, snoopy...@GMAIL.COM (Joe Matise) wrote:
> > Assuming you have unique record ID variable for A, you can just do any of
> > the methods of identifying multiple rows with the same value for a var.
> >
> > Such as:
> >
> > (sorted by RID)
> >
> > data dups;
> > set have;
> > by rid;
> > if not (first.rid and last.rid);
> > run;
> > and then a PROC FREQ.
> >
> > or
>
> >
> > proc sql;
> > select count(1) from (select * from have group by rid having
> count(rid)>1);
> > quit;
> >
> > etc....
> >
> > -Joe
> >
> > On Mon, Feb 1, 2010 at 7:42 AM, ram.sa...@gmail.com <ram.sa...@gmail.com
> >wrote:
> >
> > > I have 2 datasets, a and b. After many to many merge using 4 key vars,
> > > is there a way to find out how many records in the dataset "a" match
> > > multiple records in dataset "b"?
>
|