search across all the following databases:
Data and documentation
Common questions and answers.
Entire collection of data resources.
The following will get rid of records that have duplicate IDs.
proc sort nodupkey; by id; proc print; var id h;
However, before one gets rid of records with duplicate IDs, one should first determine why there are duplicate IDs. A common reason for duplicate IDs, is reading the ID in with an incorrect format. For instance, if one is reading in census tract IDs using the following:
input tract 52-57;
If the input data for columns 52-57 are as follows:
where ^ indicates a blank
Tract 201.00 and 2.01 will both be treated as 201 in SAS. To differentiate between the two, the following format should be used.
input @52 tract bz6.2;