Date: Mon, 21 Aug 2006 05:39:11 -0700
Reply-To: BK <byronkirby@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: BK <byronkirby@GMAIL.COM>
Organization: http://groups.google.com
Subject: Re: URGENT: PROC SORT TO PROC SQL CONVERSION
In-Reply-To: <1156157612.146672.226840@i3g2000cwc.googlegroups.com>
Content-Type: text/plain; charset="iso-8859-1"
since you only want to return unique obs, the "max" function in the
first Solution will not have any undesirable remifications on the
dataset (may be some effency, not too sure) so try somehting like this:
/*code is free typed and thus not tested */
proc sql;
create table pqr as
select a,b,c,d,e, max(v1),max(v2), /*ect*/ ,max(v25), count (*) as cnt
from xyz
group by a,b,c,d,e
having cnt =1
quit;
run;
or try a it as a select query
proc sql;
create view test as
select a,b,c,d,e, count (*) as cnt
from xyz
group by a,b,c,d,e
/*use this or use the subsetting below*/ /* having cnt =1 */
create table pqr as
select a.*
from xyx a, test b
where
a.a=b.a and
a.b=b.b and
a.c=b.c and
a.d=b.d and
a.e=b.e and
b.cnt=1;
quit;
run;
Byron
|