HP 3000 Manuals

Example 1: Common Exit Points from PERFORM [ HP COBOL II/XL Migration Guide ] MPE/iX 5.0 Documentation


HP COBOL II/XL Migration Guide

Example 1:  Common Exit Points from PERFORM 

The following conceptual example runs on COBOL II/V but may not run on
COBOL II/XL due to the differences in architectural implementation of the
PERFORM statement's exit mechanism.  This coding technique is also a
violation of the ANSI standard and should be avoided.  If your program
contains common exit points, you can attempt to compile and execute it on
an MPE XL system.  If the results are incorrect, you should modify the
program to remove the common exit points.

                  .
                  .
             PERFORM ALPHA THRU NEWT.
                  .
                  .
         ALPHA.
                  .
                  .
             PERFORM BETA THRU NEWT.
                  .
                  .
         BETA.
                  .
                  .
         OMEGA.
                  .
                  .
         NEWT.
                  .
                  .
             DISPLAY "END OF ALPHA THRU NEWT PERFORM"
         GAMMA.
                  .
                  .

Although there are many ways to change the previous example, the
following coding method works with either COBOL II/V and COBOL II/XL:

                  .
                  .
             PERFORM ALPHA THRU NEWT-NEW.
                  .
                  .
         ALPHA.
                  .
                  .
             PERFORM BETA THRU NEWT.
                  .
                  .
         BETA.
                  .
                  .
         OMEGA.
                  .
                  .
         NEWT.
                  .
                  .
             DISPLAY "END OF ALPHA THRU NEWT PERFORM"
         NEWT-NEW.
         GAMMA.
                  .
                  .



MPE/iX 5.0 Documentation