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: Call for Content

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!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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