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 can you learn from the sas log when debugging? : Sas programming

0 Answers  


what is scheduling and how will u implement it. In scheduling 5 jobs r running if there is an error occured at 3rd job and how will u check and waht necessary steps will u take not to repeat the same mistake

0 Answers   Blue Star,


I have 50 variables in one data set, In reports i want to generate every 10 variables in one page how we will write code in proc report.

4 Answers  


Is it possible to do sorting tranformation in charecter variable??if can tell me one eg..

1 Answers  


What do you understand by the term Normal Distribution?

0 Answers  






There is a field containing a date. It needs to be displayed in the format "ddmonyy" if it's before 1975, "dd mon ccyy" if it's after 1985, and as 'Disco Years' if it's between 1975 and 1985. How would you accomplish this in data step code? Using only PROC FORMAT

8 Answers   D&B,


what are several options for creating reports in web report studio? : Sas-bi

0 Answers  


how to change the execute of macro

0 Answers   Mind Tree,


Could you please answers for this. 1.Code the tables statement for a single-level (most common) frequency. 2.Code the tables statement to produce a multi-level frequency.

2 Answers  


How do you download a flat file from Mainframe to your local PC using SAS?

3 Answers  


my problem is to export my report to xsl.i can do that.but the problem is my report has 3 headings first heading should be printed with the merging of (1-5)cells and heading 2 should be of merge(2-4)cells?how to do this condition?

2 Answers   Dr Reddys, Oracle,


How do I CREATE an external dataset with sas code? I would like to create within a sascode a non-exsistent textfile on the host. So I am not forced to create the file befor filling it.

2 Answers  


Categories