DO Statement

<do statement>

── DO ── <statement> ─┬─────┬─ UNTIL ── <Boolean expression> ──────────┤
                      └─ ; ─┘

Explanation

The DO statement enables a job to execute a statement until a condition is TRUE.

The statement is executed and the Boolean expression is evaluated. If the expression is TRUE, control passes to the next executable statement; otherwise, the statement is re‑executed.

Notes:
  • If the Boolean expression never evaluates to TRUE, the statement is repeated forever (or until the task is discontinued by an operator action or discontinued because it has exceeded queue limits).

  • If the same PROCESS statement is executed repeatedly by a DO statement, a run-time error might result. A run-time error can occur if an asynchronous task initiated by an earlier pass through the DO statement is still running. A given task variable can only be used by one task at a time.

Example

Following is a partial job that uses the DO statement:

DO BEGIN
      A:=A+1;
      RUN X[T];
        TASKVALUE=A;
   END
UNTIL T(TASKVALUE) GEQ 4;