Created
July 10, 2017 16:07
-
-
Save statgeek/1ff5a4aaca9b3f875d4defdaa598ae5e to your computer and use it in GitHub Desktop.
Identify and output duplicate records
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*This code demonstrates how to keep only duplicate observations in a data set*/ | |
%*Create sample data set; | |
data have; | |
informat name $80.; | |
input name $ found; | |
cards; | |
If_True 1 | |
If_True_kary 1 | |
If_True_kary 1 | |
If_True_John 3 | |
If_Not 24 | |
If_Not 24 | |
If_Not_Carol 24 | |
If_Not_Carol 24 | |
If_Not_Carol 24 | |
If_False_Joe 288 | |
If_False_Joe 288 | |
; | |
run; | |
%*Sort with NOUNIQUEREC option; | |
proc sort data=have out=duplicates nouniquerec; | |
by name found; | |
run; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment