How would you delete duplicate observations?

Answer Posted / srinivas

there 3 options to delete duplicate obs
1. nodup
2. nodupkey
3.noduprec

if a entire record is duplicated in sense we use nodup of
nodup rec in proc sort procedure.
proc sort data=dsn nodup/noduprec;
by var;
run;


if a variable is repeated not a entire record . this time
we use nodupkey

proc sort data=dsn nodupkey;
by var;
run;

ex; in a dataset empid is repeated then use this syn. and
the empid is used in by var statement.

Is This Answer Correct ?    19 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the data types does SAS contain?

751


describe about metadata object? : Sas-di

724


Hello, I have PROC SQLs results group by 3 fields and I use SUM and COUNT functions in SQL. The problem is when I try to display my result with PROC TABULATE. I am getting very big numbers. I believe I make a mistake some where in Tabulate. Here is my Proc Tabulate. PROC TABULATE DATA=OUT04_05 FORMAT=12.; CLASS YR CENTRE VISA / PRELOADFMT EXCLUSIVE; VAR NEWUSER FRAUD TRANSFER AUTUSER REISSUE; TABLE CENTRE ALL, (YR ALL)*VISA, (NEWUSER*F=COMMA12. AUTUSER*F=COMMA12. FRAUD*F=COMMA12. TRANSFER*F=COMMA12. REISSUE*F=COMMA12.) / MISSTEXT={LABEL='0'} PRINTMISS RTS=20; FORMAT VISA VISAFMT.; KEYLABEL SUM = ' ' ALL = 'TOTAL'; LABEL YR = 'DATE YEAR' NEWUSER = 'TOTAL NEW ACCT' TRANSFER = 'TOTAL TRANSFER' FRAUD = 'TOTAL FRAUD TRANSFER' AUTUSER = 'TOTAL AUTH USERS' REISSUE = 'TOTAL REISSUE'; When I code it like : NEWUSER*N*F=COMMA12. AUTUSER*N*F=COMMA12. I get same amount numbers but to find a NEWUSER I use COUNT(*) and to find AUTUSER I use SUM(xxxx) function so both result shouldn’t be the same my problem is in this point. Could you tell me where the problem in code is. How can I display my result? TX.

1875


how could you generate test data with no input data? : Sas programming

737


What is interleaving in SAS?

768






How do you test for missing values?

1157


How do you specify the number of iterations and specific condition within a single do loop?

712


Mention what is SAS data set?

778


If a variable contains letters or special characters, can it be numeric data type?

879


Explain input and put function?

751


Explain translate function?

745


What are the automatic variables for macro? : sas-macro

765


What are types of transport files?

7158


What is the difference between using drop = data set option in data statement and set statement?

752


what is star schema? : Sas-di

735