DATA Step, Macro, Functions and more

How to subset data based on variable value containing some characters

Reply
Super Contributor
Posts: 272

How to subset data based on variable value containing some characters

Dear,

 

In my data the 'previous id'  value present in some character values of some OBS. I need to subset the dataset containing previous id value.Please help. Thank you

 

data

 

ID        value

1      Day -00 to -0-Previous ID

2      Day -11 to -16

 

output needed;

id                value

1           Day -00 to -0-Previous ID

 

 

Super User
Posts: 19,789

Re: How to subset data based on variable value containing some characters

Posted in reply to knveraraju91

Your looking for the actual text - Previous ID? 

 

Try FINDW() or INDEXW()

 

or

 

in a Where clause you can use LIKE.  

Ask a Question
Discussion stats
  • 1 reply
  • 147 views
  • 1 like
  • 2 in conversation