Meta Search
search across all the following databases:
Data Catalog
Data and documentation
KnowledgeBase
Common questions and answers.
Resources
Entire collection of data resources.
Lessons from North of the Border
Nerd Alert: Dictionary of Numbers
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:
^201^^ ^^^201
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;