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 (January 2003, week 5)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Wed, 29 Jan 2003 09:08:32 -0500
Reply-To:   Ian Whitlock <WHITLOI1@WESTAT.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Ian Whitlock <WHITLOI1@WESTAT.COM>
Subject:   Re: Equivalent of NODUPKEY in PROQ SQL
Comments:   To: "stef.boreel@ACHMEA.NL" <stef.boreel@ACHMEA.NL>
Content-Type:   text/plain; charset="iso-8859-1"

Stef,

NODUPKEY is like FIRST. processing. Both depend on order which is an alien concept to SQL. SQL depends on information stored as data, not in variable names and not in order.

If for example you had the variables GROUP and SEQ where SEQ is a sequence number within group, then you could use a GROUP BY GROUP clause with HAVING SEQ=1. In short there must be something in the data values that indicates which records you want.

The suggestion to use DISTINCT works when all records having the same value of GROUP have all other relevant variables with equal values. This would be equivalent to the NODUP option in PROC SORT.

IanWhitlock@westat.com -----Original Message----- From: Stef Boreel [mailto:stef.boreel@ACHMEA.NL] Sent: Wednesday, January 29, 2003 7:15 AM To: SAS-L@LISTSERV.UGA.EDU Subject: Equivalent of NODUPKEY in PROQ SQL

Hello everybody,

I have a beginners question.

I succeeded in generating a subset with PROC SQL, but there still remained dupkeys. What I did was let it follow by a PROC SORT with a BY statement and a the NODUPKEY option. Is there an equivalent in PROC SQL which does the same job? I studied the OnlineDoc thoroughly but could not find the SQL solution to my question.

Thank you in advance, Stef

********************* DISCLAIMER ********************* De informatie in dit e-mail bericht is uitsluitend bestemd voor de geadresseerde. Verstrekking aan en gebruik door anderen is niet toegestaan. Door de electronische verzending van het bericht kunnen er geen rechten worden ontleend aan de informatie. ************************************************************


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