COBOL - Conditional Expression
A conditional expression causes the object program to select alternative paths of
control, depending on the truth value of a test. Conditional expressions are
specified in IF, EVALUATE, PERFORM, and SEARCH statements.
A conditional expression can be specified in either simple conditions or complex
conditions. Both simple and complex conditions can be enclosed within any
number of paired parentheses; the parentheses do not change whether the
condition is simple or complex.
Simple Conditions
There are five simple conditions:
-
If condition
-
Class condition
-
Condition-name condition
-
Relation condition
-
Sign condition
-
Switch-status condition
A simple condition has a truth value of either true or false.
If you have any doubts or queries related to this chapter, get them clarified from our Mainframe experts on ibmmainframer Community!