03-04-2015 02:41 AM
input accid $;
proc sort data=have;
data want (rename=count=uniqid);
if first.accid then count+1;
03-04-2015 06:56 AM
Just by looking in your example, it looks like a surrogate key.
What's the application/requirement? This will just create 1-1 relationships.
If you want to work with lots of data and giving them surrogate keys (and more), look an ETL tool such as DI Studio.
03-04-2015 08:18 AM
If you don't want to sort you could do something like this. If you have multiple keys this will also work by creating a compound index and adding variables to the CLASS statement.