第1引数に等しい文字値を検索し、最初に一致した値のインデックスを返します。
| カテゴリ: | 検索 |
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;x1=1 x2=3 x3=0