Duplicate Checks

Here is a quick method to detect duplicate records within a dataset:

* Be sure the dataset is sorted properly;
Proc Sort Data=work.A; By id; Run;

Data work.duplicates;
    Set work.A;
    By id;
    If Not(First.id) or Not(Last.id) then output work.duplicates;
Run;