I have a SAS dataset with an ID variable which is supposed to be unique at the person level, but in reality there are duplicates. What I'd like to do is create a duplicate ID which only fills when a person has duplicate values of ID, like this:
ID Dupe_ID
1
2 1
2 1
3
4 2
4 2
Any help is much appreciated!