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.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.
Ready to level-up your skills? Choose your own adventure.