EVALUATE MyValue
WHEN 1
DISPLAY "My value is 1"
WHEN 2
DISPLAY "My value is 2"
WHEN OTHER
* Actually I don't need to do anything
END-EVALUATE
I think to have read somewhere that a COBOL application will crash for an EVALUATE
where the WHEN
clauses do not cover the value of the evaluated variable, if there is no WHEN OTHER
statement present. So, in order to avoid the crash, I wanted to add this empty WHEN OTHER
.
Under which circumstances is this necessary, and if so, is this approach correct?