Help using Base SAS procedures

How to delete duplicated observations in the data sets.

Reply
Occasional Contributor sos
Occasional Contributor
Posts: 12

How to delete duplicated observations in the data sets.

Hi, folks,

   I find that there are lots of duplicated observations in my data sets. Is there a code to delete them automatically?

Thanks!

Wu

PROC Star
Posts: 7,480

How to delete duplicated observations in the data sets.

proc sort data=yourdatafile nodupkey;

  by thevariablelistwithinwhichyoudontwantduplicates;

run;

may do what you want.

Super User
Posts: 11,343

How to delete duplicated observations in the data sets.

Possibly more effecient in some situations:

Proc sql;

     Create table nodup as

     select distinct *

     from yourdataset;

quit;

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