LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (August 2006, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
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
Comments: To: sas-l@uga.edu
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


Back to: Top of message | Previous page | Main SAS-L page