Date: Mon, 12 Oct 1998 17:55:54 -0700
Reply-To: "Self, Karsten" <kself@VISA.COM>
Sender: "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From: "Self, Karsten" <kself@VISA.COM>
Subject: Re: PROC SORT NODUP Option
Karsten M. Self (firstname.lastname@example.org)
What part of "Gestalt" don't you understand?
> From: LPogoda[SMTP:email@example.com]
> Sent: Friday, October 09, 1998 5:53 PM
> To: SAS-L@UGA.CC.UGA.EDU
> Subject: Re: PROC SORT NODUP Option
> In article <firstname.lastname@example.org>, "Steven E.
> <sstevens@COMCAT.COM> writes:
> >I heartily agree & cannot recall a single situation in the past 12 years
> >have been programming with SAS that I have used NODUP (NODUPKEY is
> >matter, though caution is still required).
> Isn't the use of NODUP exactly analogous to using SELECT DISTINCT in PROC
> Do you use SQL? Is it possible that you're not using NODUP because you're
> using SELECT DISTINCT instead?
No, it is not, and this is one of the dangers of NODUP.
NODUP says that, after sorting by KEYS, ADJACENT identical records will be
reduced to a single output record. Identical, NONADJACENT records will not
be reduced to a single output record. If KEYS are VAR1 and VAR2, and
identical but non-adjacent values of VAR3 and VAR4 exist, the problem will
SELECT DISTICT will, truly, select distinct values from a query. It is
similar in function to:
PROC SORT DATA= FOO NODUP;
PROC SORT DATA= FOO DODUPKEY;
SORT with the NODUP or NODUPKEY options still relies on the VAR statement in
determining what values are identified as distinct. SQL SELECT DISTINCT
results in distinct values of selected fields from the query expression.