Prev: Equivalent of NODUPKEY in PROC SQL?
Next: Slightly OT: Graphic of Unemployment in the United States
From: Arthur Tabachneck on 1 Dec 2009 11:10 Curtis, Take a look at Ian's response a while back: http://www.listserv.uga.edu/cgi-bin/wa?A2=ind0301E&L=sas- l&D=1&H=0&O=D&T=1&P=4118 or, in short form: http://xrl.us/bgeqoo Art --------- On Tue, 1 Dec 2009 11:01:10 -0500, Curtis E. Reid <reid.curtis(a)BLS.GOV> wrote: >Hi! > >What is the equivalent of NODUPKEY (PROC SORT) in PROC SQL? Using >DISTINCT doesn't seem to do the trick well. Thanks in advance! > >Curtis E. Reid >Bureau of Labor Statistics (BLS)
From: "Curtis E. Reid" on 1 Dec 2009 11:28 Art, Thanks for the quick response. I didn't go that far back to 2003! It pretty much sums it up. Thanks. Curtis
From: Marc Weinmann on 2 Dec 2009 16:42 One option is to use SQL's GROUP BY to aggregate to the level of uniqueness needed, and then drop the column created by an aggregate expression of your choice. Perhaps: Proc sql; create dataset2 as (select count(*) as count, var1, var2, var3 from dataset1 group by var1 var2 var3); alter table dataset2 drop count; quit;run; -----Original Message----- From: SAS(r) Discussion [mailto:SAS-L(a)LISTSERV.UGA.EDU] On Behalf Of Curtis E. Reid Sent: Tuesday, December 01, 2009 10:01 AM To: SAS-L(a)LISTSERV.UGA.EDU Subject: Equivalent of NODUPKEY in PROC SQL? Hi! What is the equivalent of NODUPKEY (PROC SORT) in PROC SQL? Using DISTINCT doesn't seem to do the trick well. Thanks in advance! Curtis E. Reid Bureau of Labor Statistics (BLS)
|
Pages: 1 Prev: Equivalent of NODUPKEY in PROC SQL? Next: Slightly OT: Graphic of Unemployment in the United States |