Product Site

C.1.5. Error 7 - WHEN or OTHERWISE expected.

Explanation:

At least one WHEN clause (and possibly an OTHERWISE clause) is expected within a SELECT instruction. This message is issued if any other instruction is found or there is no WHEN clause before the OTHERWISE or all WHEN expressions are false and an OTHERWISE is not present. A common cause of this error is if you forget the DO and END around the list of instructions following a WHEN. For example:
WRONG                   RIGHT

Select                  Select
  When a=c then           When a=c then DO
    Say 'A equals C'        Say 'A equals C'
    exit                    exit
  Otherwise nop           end
end                      Otherwise nop
                        end

The associated subcodes are:
001

SELECT on line line_number requires WHEN.
002

SELECT on line line_number requires WHEN, OTHERWISE, or END.
003

All WHEN expressions of SELECT are false; OTHERWISE expected.