Navigating in COBOL source files
The editors provide various ways to navigate to and from data items.
About this task
Supported Editors:
- COBOL Editor
- z Systems® LPEX Editor
Procedure
Viewing a COBOL program structure
Use the Open Perform Hierarchy action to see the structure of a COBOL program.
About this task
Results from Open Perform Hierarchy are available in the Perform
Hierarchy view. The Perform Hierarchy view is a tree graphic that
displays paragraph and line numbers for each statement in the hierarchy. By using this view, you can
navigate among those statements as shown in the following graphic.

Each paragraph is identified by an icon (
). The paragraph icon can contain decorators that provide more
information about the paragraph.

- Indicates conditional processing.

- Indicates loop processing, such as self referencing GO TO statements.

- Indicates that an exception occurred.
Limitation: Changes to the control flow made by starting user-defined
functions are not represented in this view.
Procedure
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
Using the COBOL Outline view
When you open a file in the editor, an outline of the file opens in the Outline view. In the Outline view, you can expand or collapse program divisions, show or hide parts of a program, or filter parts of a program.
About this task
| Icon | Outline element |
|---|---|
![]() |
IDENTIFICATION DIVISION |
![]() |
CONFIGURATION SECTION |
![]() |
INPUT-OUTPUT SECTION |
![]() |
DATA DIVISION |
![]() |
FILE SECTION |
![]() |
WORKING-STORAGE SECTION |
![]() |
LOCAL-STORAGE SECTION |
![]() |
LINKAGE SECTION |
![]() |
REPORT SECTION |
![]() |
PROCEDURE DIVISION |
|
|
FUNCTION |
![]() |
DECLARATIVES |
![]() |
PARENT DATA ELEMENT |
![]() |
DATA ELEMENT |
![]() |
SECTION |
![]() |
PARAGRAPH |
![]() |
COPY |
Procedure
Navigating a source file with quick outline
Open a quick outline to see the structure of COBOL, JCL, and PL/I files and navigate in files.
About this task
Procedure
- To open the quick outline, click or press Ctrl+O.
The quick outline opens on top of the editor. It contains a search filter and an outline of the content of the editor.
- To filter the content of the quick outline, type the text
that you want to show in the filter. Elements that contain matching text and their ancestors are shown in the outline tree. The first matching element is selected in the outline.
- To close the quick outline and navigate to the selected element in the source file, press Enter or double-click the element.
) icon to go back to a previous location and the right arrow
(
) icon to move forward. These icons are in the
menu bar.

















