BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
novinosrin
Tourmaline | Level 20

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;
d0816
Quartz | Level 8

@novinosrin 

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_DateEnd_DateClassEnd_ReasonIDCollegeLocationLocation_NumberSessionCollege_Name
2014-102014-10-282014-10-31AUNSC/INT50UM40TMU
2014-112014-11-01 A.50UM40TMU
2014-112014-11-012014-11-30AUNSC/INT50UM40TMU
2016-042016-04-29 A.51UM40TMU
2016-042016-04-292016-04-29ASC51UM40TMU
2018-062018-06-112018-08-30ASC51UM40TMU

 

novinosrin
Tourmaline | Level 20

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. 

d0816
Quartz | Level 8

@novinosrin Sounds good. Thank you.

 

 

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 18 replies
  • 12981 views
  • 0 likes
  • 4 in conversation