SAS has some very powerful ways to find duplicate values and to store the duplicates separate from the unique values. Many of these use the sort procedure. Here is a nice guideline for what would otherwise be very difficult to figure out on your own.

Eric Cai. Separating Unique and Duplicated Observations Using PROC SORT in SAS 9.3 and Newer Versions. The Chemical Statistician blog, April 10, 2015. Available in html format.

This Recommendation was added to the website on 2019-04-18 and was last modified on 2020-02-29. You can find similar pages at Data management, SAS software.

An earlier version of this page appears here.