Rational Developer for System z
Enterprise COBOL for z/OS, Version 4.1, Programming Guide


Example: PERFORM procedure integration

The following example shows code that will be transformed by procedure integration.

All the PERFORM statements in the following program will be transformed:

1   SECTION 5.
11. PERFORM 12
    STOP RUN.
12. PERFORM 21
    PERFORM 21.
2   SECTION 5.
21. IF A < 5 THEN
      ADD 1 TO A
      DISPLAY A
    END-IF.

The program will be compiled as if it had originally been written as follows:

1   SECTION 5.
11.
12. IF A < 5 THEN
      ADD 1 TO A
      DISPLAY A
    END-IF.
    IF A < 5 THEN
      ADD 1 TO A
      DISPLAY A
    END-IF.
    STOP RUN.

By contrast, in the following program only the first PERFORM statement, PERFORM 12, will be optimized by procedure integration:

1   SECTION.
11. PERFORM 12
    STOP RUN.
12. PERFORM 21
    PERFORM 21.
2   SECTION 5.
21. IF A < 5 THEN
      ADD 1 TO A
      DISPLAY A
    END-IF.

related concepts  
Optimization of table references

related tasks  
Optimizing your code  
Tuning your program


Terms of use | Feedback

This information center is powered by Eclipse technology. (http://www.eclipse.org)