IN-LINE perform :
in an in-line perform the paragraph name is omitted and it should be delimited by the END-PERFORM phrase.
syntax:
PROCEDURE DIVISION.
PERFORM .......
STATEMENT 1
.... 2
.... 3
END-PERFORM.
Here all the statements under the perform will get executed till the END-PERFORM phrase is reached.
The PERFORM statement formats are:
1. Basic PERFORM
2. TIMES phrase PERFORM
3. UNTIL phrase PERFORM
4. VARYING phrase PERFORM
Basic PERFORM.
PERFORM para-1 thru para-2
PERFORM
imperative statement
END-PERFORM.
PERFORM with UNTIL phrase
PERFORM procedure-1 thru procedure-2 until condition-1.
If the condition is true the PERFORM statement is initiated, the specified procedures are not executed.
PERFORM with VARYING phrase
PERFORM para-1 thru para-3 varying N from 1 by 1 until N > 5.
In the above example Para-1 thru Para-3 will be executed 5 times.
in an in-line perform the paragraph name is omitted and it should be delimited by the END-PERFORM phrase.
syntax:
PROCEDURE DIVISION.
PERFORM .......
STATEMENT 1
.... 2
.... 3
END-PERFORM.
Here all the statements under the perform will get executed till the END-PERFORM phrase is reached.
The PERFORM statement formats are:
1. Basic PERFORM
2. TIMES phrase PERFORM
3. UNTIL phrase PERFORM
4. VARYING phrase PERFORM
Basic PERFORM.
PERFORM para-1 thru para-2
PERFORM
imperative statement
END-PERFORM.
PERFORM with UNTIL phrase
PERFORM procedure-1 thru procedure-2 until condition-1.
If the condition is true the PERFORM statement is initiated, the specified procedures are not executed.
PERFORM with VARYING phrase
PERFORM para-1 thru para-3 varying N from 1 by 1 until N > 5.
In the above example Para-1 thru Para-3 will be executed 5 times.
No comments:
Post a Comment