DO

Purpose

Read syntax diagramSkip visual syntax diagram
>>-DO--| repetitor |--| conditional |--;--+-----------------+--->
                                          | .-------------. |   
                                          | V             | |   
                                          '---instruction-+-'   

>--END--+------+--;--| repetitor |------------------------------>
        '-name-'                     

>--+-name=expri--+-----------+--+-----------+--+------------+-+-><
   |             '-TO--exprt-'  '-BY--exprb-'  '-FOR--exprf-' |   
   +-FOREVER--------------------------------------------------+   
   '-exprr----------------------------------------------------'   

conditional

|--+-WHILE--exprw-+---------------------------------------------|
   '-UNTIL--expru-'   

DO groups instructions together and optionally processes them repetitively. During repetitive execution, a control variable (name) can be stepped through some range of values.
Syntax Notes:
  • The exprr, expri, exprb, exprt, and exprf options (if present) are any expressions that evaluate to a number. The exprr and exprf options are further restricted to result in a positive whole number or zero. If necessary, the numbers are rounded according to the setting of NUMERIC DIGITS.
  • The exprw or expru options (if present) can be any expression that evaluates to 1 or 0.
  • The TO, BY, and FOR phrases can be in any order, if used, and are evaluated in the order in which they are written.
  • The instruction can be any instruction, including assignments, commands, and keyword instructions (including any of the more complex constructs such as IF, SELECT, and the DO instruction itself).
  • The subkeywords WHILE and UNTIL are reserved within a DO instruction, in that they cannot be used as symbols in any of the expressions. Similarly, TO, BY, and FOR cannot be used in expri, exprt, exprb, or exprf. FOREVER is also reserved, but only if it immediately follows the keyword DO and an equal sign does not follow it.
  • The exprb option defaults to 1, if relevant.

Reference Reference

Feedback


Timestamp icon Last updated: Tuesday, 7 January 2014


http://pic.dhe.ibm.com/infocenter/cicsts/v5r1/topic/com.ibm.cics.rexx.doc//dfhrx/do.html