How would you delete duplicate observations?
Answer Posted / srinivas
there 3 options to delete duplicate obs
1. nodup
2. nodupkey
3.noduprec
if a entire record is duplicated in sense we use nodup of
nodup rec in proc sort procedure.
proc sort data=dsn nodup/noduprec;
by var;
run;
if a variable is repeated not a entire record . this time
we use nodupkey
proc sort data=dsn nodupkey;
by var;
run;
ex; in a dataset empid is repeated then use this syn. and
the empid is used in by var statement.
| Is This Answer Correct ? | 19 Yes | 5 No |
Post New Answer View All Answers
How would you identify a macro variable? : sas-macro
Explain what is data step?
WHAT IS SAS WEB SERVICE and what are the steps to create an xml service ?
If money were no object, what would you like to do?
what are 5 ways to perform a table lookup in sas? : Sas-administrator
What do you know about sas data set?
what is study design in while working with SAS? what are screening variables in SAS?
What does the trace option do?
how to remove duplicates using proc sql?
How to create a permanent sas data set?
Are you involved in writing the inferential analysis plan? Tables specfications?
What do the SAS log messages "numeric values have been converted to character" mean?
data data1; input dt account; format dt date9.; cards; 1745 1230 1756 1120 1788 1130 1767 1240 ; data data2; input startdt enddt total; format startdt date9. enddt date9.; cards; 1657 1834 12300 1557 1758 16800 1789 1789 12300 1788 1345 12383 1899 1899 13250 ; proc sql; create table data3 as select * from data1 as x left join data2 as y on x.dt>=y.startdt and x.dt<=y.enddt; quit; Here, we are getting cartision product. But,I want left join report consisting of this program. It should not get duplicate values. you can modify the program also.
What was the last computer book you purchased? Why?
what is the function of catx syntax? : Sas-administrator