Hello,
I currently have data that looks like this.
NAME OFFICE_ID YEAR_QTR END_TERM
BILL 1 20021 20024
BILL 2 20021 20022
JOE 3 20021 20033
JOE 4 20021 20031
For each person, I would like to flag the Office_ID with the latest End_Term, so my data would look something like this
NAME OFFICE_ID YEAR_QTR END_TERM FLAG
BILL 1 20021 20024 1
BILL 2 20021 20022 0
JOE 3 20021 20033 1
JOE 4 20021 20031 0
I would like to achieve this using PROC SQL, but any tips are welcome. Thank you very much. I am using SAS 9.1.