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

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

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!

Register now

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
  • 744 views
  • 0 likes
  • 2 in conversation