Without a case-operand, the when-expressions must resolve to logical values. Your first expression (strip(col1)) evaluates to a character value. It will be considered FALSE when the result is missing and TRUE otherwise. When it is FALSE then the second condition (anyalpha(strip(col1))) will also be false since strip(col1) is missing and the else-expression will be returned. So, I think that this expression will always evaluate to DIGIT.