I have a situation where the data look like the following:
So here I have a dataset of Students who took a test with different teachers. My aim is to extract the highest grade achieved for each student, and the accompanying teacher. In the dataset, It's possible to have ties on the highest grades. In this case, I'd just like to make a new variable called 'flag' and give it a value of 'T'. For these students the Grade and the Teacher is irrelevant - I'm only interested in knowing that there was a tie, if the tie is the highest grade.
So for example, my output dataset (based on the above) would look like the following.
I've been playing around with retain statements and have looked into using multiple by variables (i.e, first.student, first.teacher) and I think retain is the way to go. I can't exactly shown what I've attempted as the code is located on the unix. Could anyone offer some tips for writing code to perform this task?