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 (October 2009, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Mon, 19 Oct 2009 21:47:04 -0400
Reply-To:   Sigurd Hermansen <HERMANS1@WESTAT.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Sigurd Hermansen <HERMANS1@WESTAT.COM>
Subject:   Re: PROC SORT NODUPKEY
Comments:   To: Adrienne <adrienne.ingrum@GMAIL.COM>
In-Reply-To:   <e4c127fc-0a45-424a-a137-b0defa998399@x5g2000prf.googlegroups.com>
Content-Type:   text/plain; charset="us-ascii"

Adrienne: These statements do not conform to SAS syntax, Data step or PROC SQL: >> proc sort nodupkey; by emplid >> proc sql; create table a as select distinct emplid data a; set b; by emplid; if first.emplid

I would expect that they would generate syntax errors, but yield nothing else. Why would you expect that they should delete duplicate entries?

Have you tried proc sql; create table a as select distinct emplid from b ; quit; S

-----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Adrienne Sent: Thursday, October 15, 2009 2:26 PM To: SAS-L@LISTSERV.UGA.EDU Subject: PROC SORT NODUPKEY

I have an employee id variable. The majority of the entries are a 5 digit number (e.g. 54200); however, there are a few 5 digit numbers with a leading C (e.g. C0001). I've been trying to get a list of the employees included in a certain database. I've tried the following 3 options:

proc sort nodupkey; by emplid proc sql; create table a as select distinct emplid data a; set b; by emplid; if first.emplid

With all of these options, it does delete duplicate entries of the employee id's with only numbers, but gives me all of the entries for the employee id's with the leading C. This is a text variable.

Why is this happening? How do I fix it?

Thanks.


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