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
Content-Type: text/plain; charset="us-ascii"
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
create table a as select distinct emplid from b
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Adrienne
Sent: Thursday, October 15, 2009 2:26 PM
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
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?