DOW (Do While)

Free-Form Syntax DOW{(MR)} indicator-expression
Code Factor 1 Extended Factor 2
DOW (M/R) indicator-expression

The DOW operation code precedes a group of operations which you want to process when a given condition exists. Its function is similar to that of the DOWxx operation code. An associated ENDDO statement marks the end of the group. It differs in that the logical condition is expressed by an indicator valued expression (indicator-expression). The operations controlled by the DOW operation are performed while the expression in indicator-expression is true. See Chapter 20. Expressions for details on expressions. For information on how operation extenders M and R are used, see Precision Rules for Numeric Operations.

For fixed-format syntax, level and conditioning indicators are valid. Factor 1 must be blank. Factor 2 contains the expression to be evaluated.

For more information, see Compare Operations or Structured Programming Operations.

Figure 308. DOW Operation
 *..1....+....2....+....3....+....4....+....5....+....6....+....7...+....
 * In this example, the do loop will be repeated until the condition
 * is false. That is when A > 5 or B+C are not equal to zero.

 /FREE
    dow (a <= 5) and (b + c = 0);
       do_something (a:b:c);
    enddo;
 /END-FREE


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