Synopsis
This is an error in the way the REXX script is written. Some THEN or ELSE keyword appears where it should not be.
Cause
You forgot to put an IF or a WHEN keyword before the THEN keyword.
Cure
THEN can't be used without a preceding IF or WHEN. Make sure that, for every THEN, there is one matching IF or WHEN before it (and no other THEN inbetween).
Cause
You forgot to put a THEN keyword before the ELSE keyword.
Cure
ELSE can't be used without a preceding THEN. Make sure that, for every ELSE, there is one matching THEN before it (although there may be a preceding ELSE inbetween).
Cause
You tried to name a variable then or else in a place where a THEN or ELSE keyword would be illegal.
Cure
In certain instructions, you cannot use (unquoted) REXX keywords THEN or ELSE for variable names.