COBOL ‘EVALUATE ALSO’ Best Examples

Evaluate is an alternative to the IF condition. To give multiple conditions, you need to use IF conditions. But using the Evaluatewith ALSO you can simplify the code. The Evaluate with ALSO equals the AND condition.

Evaluate with ALSO

With the Evaluate, you can test two or more conditions using ALSO. Below, you will find an example of it.

EVALUTAE TRUE ALSO TRUE
WHEN SEX = 'M' ALSO SEX = 'F'
PERFORM PARA-1
WHEN OTHER
CONTINUE
END-EVALUAtE
Advertisements

Evaluate Complex Conditions

Evaluate True Also True
When A + B < 10 Also C = 10
Move "Case 1" To Description
When A + B > 50 Also C = ( D + E ) / F
Move "Case 2" To Description
When Other
Move "Case Other" To Description
End-Evaluate

Checkout Best Low-cost e-books on Complex Interview Questions

References

Related Posts

Author: Srini

Experienced software developer. Skills in Development, Coding, Testing and Debugging. Good Data analytic skills (Data Warehousing and BI). Also skills in Mainframe.