How would you delete observations with duplicate keys?

Answers were Sorted based on User's Feedback



How would you delete observations with duplicate keys?..

Answer / mohan reddy

proc sort data=work.abc nodupkey;
by eno;
run;

when u have delete duplicatie obervation from dataset. u can
use the nodupkey along with the by variable.

Is This Answer Correct ?    10 Yes 0 No

How would you delete observations with duplicate keys?..

Answer / g.jyotshna

proc sort data=datasetname nodup;
by var;
run;
proc sort data=datasetname nodupkey;
by var;
run;
proc sort data=datasetname noduprecs;
by var;
run;

Is This Answer Correct ?    4 Yes 0 No

How would you delete observations with duplicate keys?..

Answer / rohit

You can also use a Proc SQL statement with a Distinct
keyword.

Proc Sql;
Select Distinct tablename.* from tablename;
Quit;

Is This Answer Correct ?    3 Yes 0 No

How would you delete observations with duplicate keys?..

Answer / vijay

proc sort nodupkey;by var;run;

Is This Answer Correct ?    2 Yes 1 No

How would you delete observations with duplicate keys?..

Answer / upendra

Data <datasetname>;
Set <datasetname>;
by <var>;
If last.var;
run;

Is This Answer Correct ?    1 Yes 0 No

How would you delete observations with duplicate keys?..

Answer / siddu

proc sort data=<master dataset> out=(newdata set name>
nodup key;
by <key variable>;
run;

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More SAS Interview Questions

What is the difference between the proc sql and data step?

0 Answers  


Differentiate between ceil and floor functions.

0 Answers  


Why and when do you use proc sql?

0 Answers  


How to limit decimal places for the variable using proc means?

0 Answers  


Suppose there is a SAS dataset with following values - Parent Child A B B C D E F G G H H I and so on….. This goes onto 1000s of observations/rows. Now how do we identify from this dataset Grandparents and Grandchildrens ?

5 Answers   American Express, Barclays,






What is criteria for adverse events and treatment-emergent adverse events?

2 Answers   Accenture,


what is incremental update ? is this possible in SAS OLAP CUBE STUDIO.

1 Answers   TCS,


1.How many ways are there to create variables? 2.What is CLM,how can we use it? 3.what are the advontages of data step? 4.what is the extension of editor window in SAS 9.1.3? 5.How do you copy a particular data set from one library to another? 6.what is the use of double option? 7.Advontages of Proc Report? 8.what is the basic use of where statement? 9.How do you terminate the statments in SAS Programming? 10.What is the difference between symput and symget? 11.How would a identify the local and global variable? can any one answer for the 4'th question

8 Answers   CitiGroup,


Hi , which book should i refer to for preaparing SAS statistical Exam. Searched a lot on books but still did n't find relevant books

2 Answers  


Can we create datasets by proc step ? (Proc contents, Means)?

2 Answers  


What is the Program Data Vector (PDV)? What are its functions?

5 Answers   Accenture,


what are some differences between proc summary and proc means? : Sas programming

0 Answers  


Categories