Home > Data Services > Catalog . Restricted Data . Census . ACS

Search Data Services

Meta Search
search across all the following databases:

Data Catalog
Data and documentation

KnowledgeBase
Common questions and answers.

Resources
Entire collection of data resources.


Latest Data News

RSS Feed icon

Lessons from North of the Border

Nerd Alert: Dictionary of Numbers

International Migration Statistics for the US

Open Data Executive Order

Measuring Marriage & Divorce among Same-Sex Couples

Removing records with duplicate IDs

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;