Created
September 2, 2017 19:55
-
-
Save statgeek/5b00bc3db0a1b43b5d944bac2e866642 to your computer and use it in GitHub Desktop.
SAS - PROC SORT identifying 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 example demonstrates how to get a list of duplicates based on the key variables. | |
KEY variables are placed in the BY statement. | |
Any 'duplicates' according to the KEY variables are kept in the OUT= dataset | |
*/ | |
*Generate sample data with duplicate KEY; | |
data class; | |
set sashelp.class sashelp.class(obs=5); | |
run; | |
*Use the NOUNIQUEKEYS to get rid of unique records and keep duplicates; | |
proc sort data=class nouniquekeys out=duplicates; | |
by name; | |
run; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment