COBOL EVALUATE TRUE
The following COBOL program depicts the use of
01 WS-SUB PIC 9 VALUE ZEROS.
MOVE 5 TO WS-SUB.
DISPLAY 'WS-SUB IS GREATER THAN 4'
DISPLAY 'WS-SUB IS GREATER THAN 5'
DISPLAY 'NO CONDITION MET'
The ouput of the above program is
WS-SUB IS GREATER THAN 4
Note:- Control comes out of EVALUATE as soon as first satisfying condition is met.
If in the above case first condition was WS-SUB>1 and second condition was WS-SUB>2
then the control would have come out of EVALUATE as soon as WS-SUB>1 condition is met.
Try it yourself!!