Date: Tue, 1 Jul 2008 08:48:56 -0400
Reply-To: Sigurd Hermansen <HERMANS1@WESTAT.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Sigurd Hermansen <HERMANS1@WESTAT.COM>
Subject: Re: How to find out duplicates by using sql (Not using proc sort
dupout)
In-Reply-To: <92611a9f-ce72-4ea5-acad-0be848033f09@a32g2000prf.googlegroups.com>
Content-Type: text/plain; charset="us-ascii"
Ravi:
Thanks for providing sample data and a working input statement.
Every SAS programmer should have this simple solution in his or her
toolkit:
proc sql;
select x,count(*) as count
from a
group by x having count(*)>1
;
quit;
Expanding x into a list in the select and GROUP BY clauses yields
duplicates of classes of attributes.
S
-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of
ravikumarpsas@GMAIL.COM
Sent: Tuesday, July 01, 2008 8:36 AM
To: SAS-L@LISTSERV.UGA.EDU
Subject: How to find out duplicates by using sql (Not using proc sort
dupout)
Hi,
I am Ravi kumar.
I have a simple question.
data a;
input x;
cards;
2
6
2
9
6
;
run;
For the above question,How to findout the duplicates by using sql.
output:
2
6
Please help me on the same
Many Thanks
Ravi
|