Extracting a paragraph in a COBOL program

The LPEX Editor allows you to extract contiguous COBOL statements into a new paragraph.

Before you begin

Before you begin, you must open a file with the LPEX Editor and the file must contain COBOL code that includes a Procedure Division.

About this task

The action is enabled based on the validity and the completeness of selected text:
Validity
Means that the action is enabled only when text is selected in the Procedure Division of the COBOL source. Furthermore, if you select a COBOL word or variable name, the action is disabled.
Completeness
Means that the selected text contains one or more valid COBOL statements. It also means that if you select a partial statement such as an IF statement or a partial PERFORM statement, the action is disabled until you extend the selection to select the complete IF or PERFORM statement.

To extract a paragraph, complete the following steps:

Procedure

  1. Select valid text and right-click. A menu is displayed.
  2. Click Refactor > Extract Paragraph. An Extract Paragraph window is displayed.
  3. In the Extract Paragraph window, perform the following tasks:
    1. Fill in the New paragraph name field.
    2. Optionally fill in the End paragraph name and Commentfields.
    3. Specify the extraction location: Closest valid location or At the end.
    4. If you want to extract the paragraph into a new section, select the Extract into a new section check box, and type the new section name, and specify the section after which the new section is to be placed.
    5. If you want to generate paragraph comments, select the Generate paragraph comments check box.
    6. Perform one of the following actions:
      • Click OK.
      • Click Preview after optionally selecting Force preview.
      A "Found problems" window is displayed.
  4. Click Continue. If you clicked Preview in the previous step, a preview window is displayed.
  5. If a preview window is displayed, click OK.

Feedback