it is not exactly like this:
all cobol instructions can be closed with a period
for example:
MOVE variable1 TO variable2
or
MOVE variable1 TO variable2.
is the same.
in the case of "perform" it has several nuances
I'm going to write you all
PERFORM 1000-start ----> computer jump to 1000-start do stuf and then return
PERFORM 1000-start ----> the same than before
thru 1000-start _|
PERFORM 1000-start ---> the same than before but loop until end of file
until EOF
PERFORM 1000-start ----> the same than before
thru 1000-start _|
UNTIL EOF
USING "." is the same
PERFORM 1000-start. ----> compute jump to 1000-start do stuf and then return
PERFORM 1000-start ----> the same than before
thru 1000-start. _|
PERFORM 1000-start. ---> the same than before but loop until end of file
until EOF
PERFORM 1000-start ----> the same than before
thru 1000-start. _|
UNTIL EOF
USING "END-PERFORM" is a special case
The "perform" is used to jump to another part of the code, do what is there and
then return
but if you only want to use it as a for loop, that is where the END-PERFORM is
used
PERFORM varying I from 1 by 1
until I > 10
DISPLAY I
END-PERFORM
OR
PERFORM varying I from 1 by 1
until I > 10
DISPLAY I . ----> see the dot... close the PERFORM
*-------------------------------------------
1000-start.
*----------
DO STUFF
.
1000-start-exit. Exit
*-------------------------------------------
Is this explanation useful? or did I understand wrong?
--
<https://forum.pspad.com/read.php?6,76984,77028>
PSPad freeware editor https://www.pspad.com