CALL LOOP
operand1 [operand2] ...40 |
| statement
|
END-LOOP [(r)] |
CALL LOOP operand1 [operand2]
...40 |
| statement
|
LOOP [(r)] |
This document covers the following topics:
For an explanation of the symbols used in the syntax diagram, see Syntax Symbols.
Related Statements: CALL | CALL FILE | CALLNAT | DEFINE
SUBROUTINE | ESCAPE | FETCH
| PERFORM
Belongs to Function Group: Invoking Programs and Routines
The CALL LOOP statement is used to generate a processing loop that contains
a call to a non-Natural program.
Unlike the CALL statement, the
CALL LOOP statement results in a processing loop which is used to
repeatedly call the non-Natural program. See the CALL statement for a detailed description of the
CALL processing.
The statements AT BREAK, AT START OF DATA and AT END OF DATA must not be used within a
CALL LOOP processing loop.
Operand Definition Table:
| Operand | Possible Structure | Possible Formats | Referencing Permitted | Dynamic Definition | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
operand1 |
C | S | A | yes | no | |||||||||||||||
operand2 |
C | S | A | G | A | U | N | P | I | F | B | D | T | L | C | yes | yes | |||
Syntax Element Description:
| Syntax Element | Description |
|---|---|
operand1 |
Program to be Called: The name of the non-Natural
program to be called can be specified as a constant or - if different programs are
to be called dependent on program logic - as an alphanumeric variable of length 1
to 32. A program name must
be placed left-justified in the variable.
|
operand2 |
Parameters: The CALL LOOP statement
can have a maximum of 40 parameters. The parameter list is constructed as
described for the CALL
statement. Fields used in the parameter list may be initially defined in the
CALL LOOP statement itself or may have been previously defined.
|
statement
... |
Processing Loop: The CALL LOOP
statement initiates a processing loop which must be terminated with an ESCAPE statement.
|
END-LOOP (r) |
End of CALL LOOP Statement:
In structured mode, the Natural reserved word You can specify labels or line numbers with In reporting mode, the Natural statement You can specify labels or line numbers with |
LOOP
(r) |
DEFINE DATA LOCAL
1 PARAMETER1 (A10)
END-DEFINE
CALL LOOP 'ABC' PARAMETER1
IF PARAMETER1 = 'END'
ESCAPE BOTTOM
END-IF
END-LOOP
END