Viewing program control flow for a COBOL file

Program control flow provides a graphical view of the logical flow within a COBOL program. You can use this feature to identify potential logic problems or locate code that is not being used.

About this task

You can run program analysis on a COBOL file while it is in edit mode. After you start the analysis, the Program Control Flow view opens with a hierarchal graph of the parts within the program file. Each node represents a callable statement, such as a section or paragraph. The following example shows several paragraphs. To navigate from one node to another, click the node in the tree. The corresponding code is visible and highlighted in the file.

Figure 1. Example of program control flow diagram
Program analysis data of the Global Mart sample
Restriction: This feature has several restrictions:
  • The program control flow diagram does not display control flow nodes for control transfers that are generated by the following statements:
    • EXEC CICS HANDLE
    • EXEC CICS IGNORE
    • EXEC CICS PUSH
    • EXEC CICS POP
    • EXEC SQL WHENEVER
  • Quick fix is not available.

Procedure

  1. Open a COBOL file in the COBOL Editor or System z® LPEX Editor.
  2. Right-click in the file to open the menu.
  3. Click Show In > Program Control Flow. The Program Control Flow view opens with a diagram that shows the paragraph sections in the file. A brief description about the node is given when you hover over it. The description includes the paragraph name and line number of the paragraph.
  4. To view the flow further, right-click a select node in the diagram. You can narrow the tree diagram to information about a specific node. This action is helpful if the program is large because you can focus on a single paragraph. Click one of the following options.
    • Show program content flow from here: Displays the code that is called from the selected node.
    • Show program content flow to here: Displays the code that calls the selected node.
    • Show all: Displays all paragraphs in the code.

Feedback