HI @d0816
A simple tweak should do I think.
Try:
Notice is the c>1
if c=c1 and cmiss(end_date,end_reason)=2 and c>1 then delete;
I think that simple tweak worked for the said issue but again, I also have cases like below, where 2nd row for ID 50 and 1st row for ID 51 should be deleted but is not being deleted with the new tweaked code.
Thanks so much.
Start_Month | Start_Date | End_Date | Class | End_Reason | ID | College | Location | Location_Number | Session | College_Name |
2014-10 | 2014-10-28 | 2014-10-31 | A | UNSC/INT | 50 | U | M | 40 | TM | U |
2014-11 | 2014-11-01 | A | . | 50 | U | M | 40 | TM | U | |
2014-11 | 2014-11-01 | 2014-11-30 | A | UNSC/INT | 50 | U | M | 40 | TM | U |
2016-04 | 2016-04-29 | A | . | 51 | U | M | 40 | TM | U | |
2016-04 | 2016-04-29 | 2016-04-29 | A | SC | 51 | U | M | 40 | TM | U |
2018-06 | 2018-06-11 | 2018-08-30 | A | SC | 51 | U | M | 40 | TM | U |
Hi @d0816 I think the "group by combination" vs "group by id" is something that needs a fix. But since that you have a working solution , we could care less . If it comes to another thread where this approach would really be needed, we shall delve into it.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.