GO TO
should not be used to transfer control outside the current module, because any implied EXIT
points will then be
ignored. A module is either a section, a paragraph, or a set of paragraphs called with the PERFORM ... THRU ...
statement.
Noncompliant code example
PERFORM PARAGRAPH1 THRU PARAGRAPH3. > code contained between PARAGRAPH1 and PARAGRAPH3 is now considered as a module
EXIT PROGRAM.
PARAGRAPH1.
MOVE A TO B.
IF SOMETHING
GO TO PARAGRAPH3 >OK
END-IF.
IF SOMETHING-ELSE
GO TO PARAGRAPH4 >NOK as we leave the module called with "PERFORM PARGRAPH1 THRU PARAGRAPH3" statement
END-IF.
PARAGRAPH2.
MOVE A TO B.
PARAGRAPH3.
EXIT.
PARAGRAPH4.