Date: Thu, 7 Aug 2008 01:11:07 -0700
Reply-To: karma <dorjetarap@GOOGLEMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: karma <dorjetarap@GOOGLEMAIL.COM>
Organization: http://groups.google.com
Subject: Re: using proc sql
Content-Type: text/plain; charset=ISO-8859-1
On Aug 7, 8:50 am, shashi <shashi2...@gmail.com> wrote:
> Hi,
> Here I have a situation where I have to delete some observations from
> a dataset and have to pass the remaining observations into another
> dataset.
> For Example,
>
> a b
> 1 10
> 2 20
> 3 30
> 4 30
> 5 70
> 6 80
>
> Here 30 is repeated for b. Now I want to delete both the rows
> including 30 and pass the remaining all into another dataset.
> The final dataset should be
>
> a b
> 1 10
> 2 20
> 5 70
> 6 80
>
> Could anybody suggest a code in proc sql for this?
proc sql;
select a, b
from have
group by b
having count(b) = 1;
quit;
HTH
|