Stop it.
In SAS 9, we can use the function COMPARE. With the modifiers ("i", "l", ":"), we can handle the string comparison easily.
* COMPARE function Demo;
data _null_;
var = " This is test";
if left(upcase(var)) =: 'THIS' then put "Matched (1)";
if compare(var, 'THIS', 'il:') = 0 then put "Matched (2)";
run;
1 comment:
Hello.
How would you compare two strings in a macro? Actually, two words in a macro list variable.
Best,
Carsten
Post a Comment