SAS Data Integration Studio, DataFlux Data Management Studio, SAS/ACCESS, SAS Data Loader for Hadoop and others

Removing duplicate observation

Reply
Regular Contributor
Posts: 218

Removing duplicate observation

Hi All,

Can someone tell me what would be the code for removing completely identical/duplicate observations from the database?

 

Thanks.

Super User
Posts: 5,513

Re: Removing duplicate observation

Untested but it should work:

 

proc sort data=have nodupkey;

by _all_;

run;

Super User
Posts: 19,822

Re: Removing duplicate observation

NODUPRECS via proc sort, no longer in SAS 9.4 I believe

 

or 

 

DISTINCT via Proc SQL

 

proc sort data=have nodupkey out=unique1;
by _all_;
run;


proc sql;
create table unique2 as
select distinct *
from have;
quit;

 

 

 

 

Ask a Question
Discussion stats
  • 2 replies
  • 278 views
  • 0 likes
  • 3 in conversation