how to display duplicated observations in a data using base
sas.

Answers were Sorted based on User's Feedback



how to display duplicated observations in a data using base sas...

Answer / vinodhini

There are two ways to display duplicate observations.

1.In data step, using first.var and last.var

2.Using proc sort with option dupout option

Is This Answer Correct ?    16 Yes 3 No

how to display duplicated observations in a data using base sas...

Answer / aravind rangaraj

two ways u can do ot.
1. proc sort with dupout option.
2. data step:
data nodups dups;
set sample;
by x;
if first. and last. then output nodups;
else output dups;
run;
proc print data=dups;
run;

Is This Answer Correct ?    6 Yes 0 No

how to display duplicated observations in a data using base sas...

Answer / m.sivakumar

data dups;
input var1;
datalines;
1
2
3
4
4
3
5
6
;
run;
proc sort data=dups;
by var1;
run;
data dups1;
set dups;
by var1;
if not(first.var1 and last.var1) then output;
run;
proc print data=dups;
run;
proc print data=dups1;
run;

Is This Answer Correct ?    4 Yes 1 No

how to display duplicated observations in a data using base sas...

Answer / pratik

By using Dopout option we can display duplicate observation.
Proc sort data=datasetname1 nodupkey dopout=datasetname2;
by varaible.
run;
proc print data=datasetname2;
run;

Is This Answer Correct ?    3 Yes 0 No

how to display duplicated observations in a data using base sas...

Answer / lakshmi

proc sort data=data1 out=data2 dupout=dup_data1 nodupkey;
by usubjid;
run;

the dataset dup_data1 has the duplicate observation.

Is This Answer Correct ?    3 Yes 2 No

how to display duplicated observations in a data using base sas...

Answer / sheetal

If you are using SAS version 9 then use dupout option with
proc sort.

Is This Answer Correct ?    2 Yes 2 No

how to display duplicated observations in a data using base sas...

Answer / prakash hullathi

use frequency procedure with single column
data dups;
input var1;
datalines;
1
2
3
4
4
3
5
6
;
run;
proc freq data=dups;
tables var1/norow nocol nopercent;
run;


The output will be like this


var1 frequency cumulative frequency
1 1 1
2 1 2
3 2 4
4 2 6
5 1 7
6 1 8


here the observations for the variable var1 3 and 4 are
appered 2 times and remaining appeared for 1 time by
seeing the frequency of corresponding variable and
observation

Is This Answer Correct ?    2 Yes 2 No

how to display duplicated observations in a data using base sas...

Answer / pranitha patel

By using dupout option...
Proc sort data = X out = Xclean
Dupout = X dups nodupkey :
By variable :
Run:

Is This Answer Correct ?    0 Yes 0 No

how to display duplicated observations in a data using base sas...

Answer / manoj

Dupout Option
It is available on V9.1 onwards.

proc sort data=demo dupout=demo1 out=demo3 nodupkey;
by var1;
run;

Is This Answer Correct ?    0 Yes 1 No

how to display duplicated observations in a data using base sas...

Answer / dilip

proc sort data=x out=y;
by v;
data m;
set y;
by v;
if first.v and last.v then delete;
run;


this is for extracting duplicate observations
from a dataset

Is This Answer Correct ?    1 Yes 3 No

Post New Answer

More SAS Interview Questions

what is intially documentation for a sas programmer?

2 Answers   Accenture,


what is prime numbers? how we can get plc write sas code?

5 Answers   Icon,


What is the function of Stop statement in a SAS Program?

0 Answers  


what kind of variables are collected in AE dataset?

3 Answers   Accenture, Quintiles, SAS,


hi here is a problem can anybody solve this? i want to report the data through third party file. by using data _null_ or proc report or macro automation process. but i want to insert the 'titles and footnotes' in between the data and also starting of 2nd and ending of 2nd and starting of 3rd and ending of the 3rd page. tell me how and write the code?

0 Answers   Cognizant,






If reading a variable length file with fixed input, how would you prevent SAS from reading the next record if the last variable didn’t have a value?

3 Answers   Accenture,


what the use of proc glm

1 Answers   Accenture, C Marc,


how can you import .csv file in to sas? : Sas programming

0 Answers  


How do you use the do loop if you don’t know how many times you should execute the do loop?

0 Answers  


explain about data integrator metadata reports? : Sas-di

0 Answers  


what are the new features included in the new version of sas i.e., Sas 9.1.3? : Sas programming

0 Answers  


how we can call macros with in data step?

17 Answers   Allianz, ManPower,


Categories