Oct 3, 2006 #1 nickdel Programmer May 11, 2006 367 GB Do anyone know of an alternative to the LIKE operand that can used in an IF statement? What I'm trying to acheive is something like this: var_a = 'Hello' IF var_a like '%llo%' then do; output; end;
Do anyone know of an alternative to the LIKE operand that can used in an IF statement? What I'm trying to acheive is something like this: var_a = 'Hello' IF var_a like '%llo%' then do; output; end;
Oct 3, 2006 #2 klaz2002 Programmer Nov 6, 2002 559 US You could use the index() function. Code: data test; set your_dataset; var_a = 'Hello' IF index(var_a,'llo') gt 0 then do; output; end; run; Klaz Upvote 0 Downvote
You could use the index() function. Code: data test; set your_dataset; var_a = 'Hello' IF index(var_a,'llo') gt 0 then do; output; end; run; Klaz