Question

I currently have a large set of objects in SAS (>100000) each with about 60 columns of data, including an ID number. There are many duplicate ID numbers in this set of data. My goal is to convert the ID numbers that I currently have into another form of ID number using a piece of software that I have. The problem is that when I input the ID numbers into the software, the converted output comes back without the duplicates, which I need. Is there any way to use the output ID numbers to somehow create a list of output IDs except with the duplicates that the original set of data had. Any language or piece of software would be fine.

Here is a illustration of what I described above.

Original IDs: 086516 677240 449370 677240 941053 449370

Output: 147244 147947 147957 148021

Preferred Output: 147244 147947 147957 147947 148021 147957

Was it helpful?

Solution

You can merge on the ID using a MERGE statement, and it will append the value to each of the records with the same ID value.

data want;
merge have(in=a) newIDs(in=b);
by id;
if a and b;
run;
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top