Re: Why this simple data step doesn't work? (findw/if/else)

Findw is a function for finding a word delimited by certain characters. Comma is not a word, it is a delimiter. If you want to find text in another you can use index() - these are all well described in the manual:

Note I use the binary choise ifn() function to simplfy the code. Also, I do not put an operator after the index, basically if index finds the character then the result is a positive number, hence if positive number=true return first, else second.

Re: Why this simple data step doesn't work? (findw/if/else)

Findw is a function for finding a word delimited by certain characters. Comma is not a word, it is a delimiter. If you want to find text in another you can use index() - these are all well described in the manual:

Note I use the binary choise ifn() function to simplfy the code. Also, I do not put an operator after the index, basically if index finds the character then the result is a positive number, hence if positive number=true return first, else second.