COBOL/400 Language Help


EVALUATE Statement

Description
The EVALUATE statement provides a shorthand notation for a series of nested IF statements. It can evaluate multiple conditions. That is, the IF statement can be made up of compound conditions. The subsequent action of the object program depends on the results of these evaluations.
->->--EVALUATE-*--identifier-1--*-*-------------------------*--->
             *--literal-1-----* +  *--------------------* +
             *--expression-1--* +  V                    + +
             *--TRUE----------* *-ALSO-*--identifier-2--*-*
             *--FALSE---------*        *--literal-2-----*
                                       *--expression-2--*
                                       *--TRUE----------*
                                       *--FALSE---------*
 
   *---------------------------------------------------*
   *----------------------------*                      +
   V                            +                      +
->--WHEN phrase-1-*--------------*-imperative-statement-1------>
                 + *-----------*+
                 + V           ++
                 *ALSO phrase-2**
 
->--*-----------------------------------*-*--------------*-----><-
   *-WHEN OTHER imperative-statement-2-* *-END-EVALUATE-*
 
 
     where phrase-1 is:
 
->->-*-ANY--------------------------------------------------*---><-
   *-condition-1------------------------------------------*
   *-TRUE-------------------------------------------------*
   *-FALSE------------------------------------------------*
   *-*---*-*-identifier-3-*-*----------------------------**
     *NOT* *-literal-3----* **-THROUGH-*-*-identifier-4-**
           *-arith-exp-1--*  *-THRU----* *-literal-4----*
                                         *-arith-exp-2--*
 
     where phrase-2 is:
 
->->-*-ANY--------------------------------------------------*---><-
   *-condition-2------------------------------------------*
   *-TRUE-------------------------------------------------*
   *-FALSE------------------------------------------------*
   *-*---*-*-identifier-5-*-*----------------------------**
     *NOT* *-literal-5----* **-THROUGH-*-*-identifier-6-**
           *-arith-exp-3--*  *-THRU----* *-literal-6----*
                                         *-arith-exp-4--*


[ Top of Page | Previous Page | Next Page | Table of Contents ]