I read about the EVALUATE statement in the COBOL/370 Language Reference Guide and am having a difficult time understanding some of the ways to use ALSO.
For example, the following is straight forward:
EVALUATE ISS-STATE
WHEN '22'
PERFORM 22-PROCESSING
WHEN '32'
PERFORM 32-PROCESSING
WHEN OTHER
PERFORM OTHER-PROCESSING
END-EVALUATE.
My question is that when ISS-STATE = '32' and certain plans, I want to PERFORM 32-PROCESSING, but when ISS-STATE = '32' and plans other than the certain plans, I want to PERFORM OTHER-PROCESSING. I currently have the following:
EVALUATE ISS-STATE
WHEN '22'
PERFORM 22-PROCESSING
WHEN '32'
IF ISS-PLAN = 'ABC' OR 'DEF'
PERFORM 32-PROCESSING
ELSE
PERFORM OTHER-PROCESSING
END-IF
WHEN OTHER
PERFORM OTHER-PROCESSING
END-EVALUATE.
Is there a way to use WHEN...ALSO... or am I better off sticking with the way I have it coded now?
Thank you in advance for your help.
Jody
For example, the following is straight forward:
EVALUATE ISS-STATE
WHEN '22'
PERFORM 22-PROCESSING
WHEN '32'
PERFORM 32-PROCESSING
WHEN OTHER
PERFORM OTHER-PROCESSING
END-EVALUATE.
My question is that when ISS-STATE = '32' and certain plans, I want to PERFORM 32-PROCESSING, but when ISS-STATE = '32' and plans other than the certain plans, I want to PERFORM OTHER-PROCESSING. I currently have the following:
EVALUATE ISS-STATE
WHEN '22'
PERFORM 22-PROCESSING
WHEN '32'
IF ISS-PLAN = 'ABC' OR 'DEF'
PERFORM 32-PROCESSING
ELSE
PERFORM OTHER-PROCESSING
END-IF
WHEN OTHER
PERFORM OTHER-PROCESSING
END-EVALUATE.
Is there a way to use WHEN...ALSO... or am I better off sticking with the way I have it coded now?
Thank you in advance for your help.
Jody