BookmarkSubscribeRSS Feed
Aayushi_17
Quartz | Level 8

I have a table say table A and it has columns as like in below pic1,

CF-458578 is the batch id and CR-12534554 is the entity ID.

Each entity ID is associated with one or more batch id.

CR-12534554 is associated with two batch id namely CF-458578 and CF-459186.

Whenever I find the keyword 'Item removed from' in the description field, I want to filter out the only the removed batch and the result should be the same as in below pic2,

 

Can u pls help me to solve this one in Proc sql

input ; 

Entity IDDescription
CR-12534554Item created
CR-12534554Item assigned to CF-458578 
CR-12534554Item removed from CF-458578 
CR-12534554Item created
CR-12534554Item assigned to CF-754456
CR-12534554Item assigned to CF-459186
CR-12534554Item assigned to CF-675584
CR-12534554Item fixed

 

this who the output is expected :

Entity IDDescription
CR-12534554Item created
CR-12534554Item assigned to CF-458578 
CR-12534554Item created
CR-12534554Item assigned to CF-754456
CR-12534554Item assigned to CF-459186
CR-12534554Item assigned to CF-675584
CR-12534554Item fixed

 

thanks in advance 

1 REPLY 1

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 1 reply
  • 694 views
  • 0 likes
  • 2 in conversation