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

i have one dataset data l; input name: $ 25; cards; manoj is a good boy to krishna krishna is a god boy to malli malli is good boy to ramana ques: here i want "manoj" observations nubers

3 Answers   SAS,


For what purpose would you use the RETAIN statement?

0 Answers   Quintiles,


Below is the table. Required to be output should be the highest number of each student_id. Example. Student_id Subject Marks 1 Hindi 86 2 Hindi 70 3 English 80 . Calculate sum and average marks for each group of student_id Example. Student_id Subject Marks Total Marks Average 1 English 40 181 60.33333 2 English 67 196 65.33333 3 English 80 160 53.33333 PLEASE PROVIDE THE CODE OF ABOVE PROBLEMS

1 Answers   Accenture, HSBC,


How would you delete duplicate observations?

9 Answers  


what is Difference between PROC SQL JOINS and MERGE?

3 Answers   Accenture, Wipro,






what are the sites did u refer for enquiries and doubts for SAS

2 Answers   UBS,


how to generate the test data in sas without input data? : Sas-administrator

0 Answers  


data abc; input x y ; cards; 1 2 5 6 7 8 7 8 1 7 5 7 ; run; Proc Freq data=abc; tables x*y / chisq nopercent nocol norow PLCORR; RUN; If we run the code, we have Polychoric Correlation = 0.9054 in the last table. I want to extract this particular entry with the value. Means I will create one dataset in which this value will be stored/extracted. I need your help in coding this. Please help me out.

2 Answers  


Explain data step in SAS

0 Answers  


Do you use PROC REPORT or PROC TABULATE? Which do you prefer? Explain.

3 Answers  


What is Tabulate.?Why we use it.? Which type of output we get from Tabulate.?

3 Answers   TCS,


Explain why double trailing @@ is used in input statement?

0 Answers  


Categories