how do we get duplicate observations in a separate dataset?
Answers were Sorted based on User's Feedback
Answer / bitla
ex:
data dup1 dup2;
set original;
by dup_var;
if first.dup_var then output dup1 else output dup2;
run;
Is This Answer Correct ? | 11 Yes | 0 No |
Answer / mallikarjuna reddy.vanna
use DUPOUT option in proc sort statement.
Is This Answer Correct ? | 12 Yes | 1 No |
Answer / natrajboga
use the dupout= and nodupkey options in proc sort and
followed by BY statemet with list of vars
proc sort data=xxx dupout=dup_xxx nodupkey;
by var1;
run;
/* see the log window */
proc print data=dup_xxx;
run;
Is This Answer Correct ? | 8 Yes | 0 No |
Answer / vipin choudhary
Proc sort data = indata;
by name;
run;
Data outdata;
set indata;
by name;
if first.name and last.name then delete;
run;
proc print data = outdata;
run;
or else you can use the dupout option in proc sort
Is This Answer Correct ? | 4 Yes | 2 No |
First sort them in descending order and then using first.var
separate all the first observations into a new dataset and
the remaining into another. So unique observations from each
group
will come into one dataset and the other duplicate
observations will enter into another dataset.
Is This Answer Correct ? | 2 Yes | 1 No |
proc sql;
create table dup_obs as (
select * from <lib>.<dsn>
group by <dup var>,<list of other vars>
having count(*)>1 )
quit;
Is This Answer Correct ? | 4 Yes | 3 No |
differnce between 8.2 and 9.1.3
what is syntax of proc merge ?
What type of tables you are using in YOUR reporting..???
2 Answers GSK GlaxoSmithKline,
Mention what is PROC in SAS?
if you have 365 no of data set and each one having different variable from each other. how will you read by creating macros and create a single data set.
How do you convert basic cube to transaction cube and transaction cube to basic cube?
do you need to know if there are any missing values? : Sas programming
How would you determine the number of missing or nonmissing values in computations?
name few built in sas transformation in DI studio ?
What is the purpose of _character_ and _numeric_?
what is the limit of the number of the rows and columns available in the worksheet? : Sas-bi
I need to find the numeric field which contains blank in between..Ex:123 456...there is blank in between the 123 456..I need to know if there is any SAS function to find a field.. Please suggest...