@novinosrin Thank you this solution using Proc SQL. The code is working for the sample dataset I provided. However, If there were only one row for an ID with missing End_date and End_Reason (meaning that the "Class" is ongoing), those got deleted too. I did not have a case like this in the sample dataset and I was not clear on this. But I do not want to delete IDs with only one row.For eg. Start_Month Start_Date End_Date Class End_Reason ID College Location Location_Number Session College_Name 2018-11 2018-11-05 . A SC 20 U M 40 TM U 2019-02 2019-02-07 . A . 21 U M 40 TM U For IDs with multiple rows, looking at all the rows for the ID, I want to delete those rows with missing End_date and End_Reason but all other data values are the same with one of the rows. If its only one row for an ID whether End_date and End_Reason are missing or not missing, I want to keep it. Sorry, I was not clear on this early on.
... View more