Usually this is caused by including the trailing spaces in the text that you are searching for. SAS stores character strings as fixed length. So you need to remove the trailing spaces before passing the string to the FINDW() function. You can use the modifiers of the FINDW() command to make this easier. I like to use SPIT as the modifiers for this.
data test;
length str $200 word $50 ;
infile cards dsd dlm='|' truncover ;
input str word ;
found_any=index(upcase(str),upcase(strip(word)));
found_word=findw(str,word,,'spit');
put (_all_) (=) ;
cards;
Successfully|success
Coca Cola,Best Buy|BEST BUY
;
str=Successfully word=success found_any=1 found_word=0
str=Coca Cola,Best Buy word=BEST BUY found_any=11 found_word=11
... View more