Searches for a character value that is equal to the first argument, and returns the index of the first matching value.
| Category: | Search |
data _null_;
array fruit (*) $12 fruit1-fruit3 ('watermelon' 'apple' 'banana');
x1=whichc('watermelon', of fruit[*]);
x2=whichc('banana', of fruit[*]);
x3=whichc('orange', of fruit[*]);
put x1= / x2= / x3=;
run;