Rational Developer for System z

Viewing the structure of COBOL perform hierarchies

When a reference to a paragraph or section is selected, you can select the Open Perform Hierarchy action from the pop-up menu.
The Perform Hierarchy view displays the paragraphs and line numbers for each statement in the hierarchy and allows you to easily navigate among those statements. The Perform Hierarchy view has the following two modes: The Performer Hierarchy displays the references to the selected paragraph. For example, given the paragraph "Copy-input-to-output," the Performer Hierarchy displays all paragraphs and sections that can transfer control to that paragraph with a statements such as Perform Copy-input-to-output. The Performee Hierarchy displays the references to other paragraphs contained within the selected paragraph. For example, given the Copy-input-to-output paragraph, the Performee Hierarchy displays a statement that can transfer control outside of the selection paragraph with statements such as Perform Read-next-input-data. Because perform hierarchies can be nested arbitrarily, the Perform Hierarchy is a tree view that lets you traverse this nesting.

Examples

Following is an example of COBOL code with the performee highlighted:

* ****************************************************************************
* Utility method for copying input data from the input file to the output file
* ****************************************************************************
  Copy-input-to-output.
* Loop until end of file for input file
     Move "0" to Input-eof
     Perform until
             NOT inputfile-success OR
             NOT outputfile-success
         PERFORM  Read-next-input-data 
         IF inputfile-success
            PERFORM Write-output-data
         End-IF
         End-perform.
      Copy-input-to-output-EXIT.
         EXIT.

* *******************************************
* Utility method for reading from input file
* *******************************************
  Read-input-data.
*    Assume text to be read into Temp-data from IN-INTERNAL-FILE
     Move Spaces to Temp-data.

In the following example from the same COBOL program the performer is highlighted:

 Procedure DIVISION USING PARMS.
* Open the input and/or output files
     PERFORM Open-files.

* Process the user request

     EVALUATE ACTION
         WHEN DO-COPY-DATASET
             PERFORM  Copy-input-to-output. 
         WHEN OTHER
             CONTINUE.
     END-EVALUATE.
     MOVE IN-FILE-STATUS
          TO PARM-IN-FILE-STATUS.
     MOVE OUT-FILE-STATUS
          TO PARM-OUT-FILE-STATUS.
     MOVE IN-VSAM-CODE
          TO PARM-IN-VSAM-CODE.
     MOVE OUT-VSAM-CODE
          TO PARM-OUT-VSAM-CODE.
     PERFORM Close-files.
     goback.

* ***************************************************
* Utility method to open the input and/or output file
* ***************************************************
  Open-files.
* Open the input file
     OPEN I-O IN-INTERNAL-FILE

Terms of use | Feedback

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