1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
* Flag cases where a given string variable contains a given word.

* The following syntax searches for the word 'spanish'.
* Ray 2002/08/16.

DATA LIST FIXED /str1 1-40(A).
BEGIN DATA 
this is a Spanish word
only Italian here
SPANISH is good
le francais est aussi ok
END DATA.
LIST.

COMPUTE flag=INDEX(UPCASE(str1),'SPANISH')>0.
FILTER BY flag.
LIST.