Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

'LIKE' Operand

Status
Not open for further replies.

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;

 
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top