How would you delete observations with duplicate keys?
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
Answer / upendra
Data <datasetname>;
Set <datasetname>;
by <var>;
If last.var;
run;
| Is This Answer Correct ? | 1 Yes | 0 No |
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 |
how do u identify a macro variable
what are the different ways of merging two datasets.name atleast 4.
How would you invoke a macro? : sas-macro
Do you think professionally?
what are methods to identify duplicate observations?
CHOOSE ANY ONE OF THE PROCEDURE FOLLOWING TO GENERATE THE REPORTS? HOW CAN YOU SAY IT IS BETTER THAN THE OTHER? AND DEFERENCIATE THESE TWO ? 1). REPORT PROCEDURE 2). TABULATE PROCEDURE
if the Id has more then two transcatiion then show the first observation, IF Id has only two observation then It show both the observation
What would be the value of month at the end of data step execution and how many observations would be there?
how to add distinctly var variable values ex.. Data a; input var; datalines; 0 1 2 3 -1 -2 -3 ; run; adding all +ve value in one varibale n do the same for -ve too
The Lion King is hosting an animal conference. All the animals in the world attend except one. Which animal does not attend?
What are some problems you might encounter in processing missing values? In Data steps? Arithmetic? Comparisons? Functions? Classifying data?
How do you convert basic cube to transaction cube and transaction cube to basic cube?