Interview Questions   Tutorials   Discussions   Programs   Videos   

SAS - How to display duplicated observations in a data using base sas?




335
views
asked mar September 20, 2014 06:30 AM  

How to display duplicated observations in a data using base sas?


           

1 Answers



 
answered By vishnoiprem   0  

We need first sort the data and than we can use proc steps:

data dups;
input var1;
datalines;
11
22
33
44
44
33
55
66
;
run;
proc sort data=dups;
by var1;
run;
data dups1;
set dups;
by var1;
if not(first.var1 and last.var1) then output;
run;
proc print data=dups;
run;
proc print data=dups1;
run; 
flag   
   add comment

Your answer

Join with account you already have

FF

Preview


Ready to start your tutorial with us? That's great! Send us an email and we will get back to you as soon as possible!

Alert