I have a dataset with the reappearance of chunks of data in identical length groups of observations, such as:
data have;
input name $ identifier ;
cards;
mary 1
mary 2
mary 2
mary 4
mary 5
mary 7
mary 6
adam 2
adam 3
adam 3
adam 7
/*remove*/
mary 1
mary 2
mary 2
mary 4
mary 5
mary 7
mary 6
/*remove*/
adam 8
mary 1
mary 2
mary 3
mary 4
mary 5
mary 7
mary 6
adam 9
mary 1
mary 2
mary 3
;
I'm hoping to remove the chunk of reappearance of mary marked by /remove/ with ordered identifier. The outcome should be like the following:
mary 1
mary 2
mary 4
mary 5
mary 6
mary 7
adam 2
adam 3
adam 7
adam 8
mary 1
mary 2
mary 3
mary 4
mary 5
mary 6
mary 7
adam 9
mary 1
mary 2
mary 3
Thank you for any help! Someone suggested a method by Hash table, but I suspect that I may not have enough memory to process the code. Could this be done by datasteps or proc sql?