翻了SAS官方关于functions 的书,找到了一个适合我这个问题的函数 indexw. 该函数的官方介绍:Function: INDEXW
Purpose: To search a string for a word, defined as a group of letters separated on both ends by a word boundary (a space, the beginning of a string, end of the string). Note that punctuation is not considered a word boundary.
本问题,用EXCEL的替换功能将逗号替换为空格,再用indexw 即成功搞定

代码:
结果: