The System z® LPEX
Editor and the COBOL Editor let you extract contiguous COBOL statements
into a new paragraph.
Before you begin
Before you begin, you must open a file with the System z LPEX Editor or the COBOL 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.
Procedure
To extract a paragraph, complete the following steps:
- Select valid text and right-click. A menu
is displayed.
- Click . An Extract Paragraph wizard
is displayed.
- In the Extract Paragraph wizard, perform
the following tasks:
- Fill in the New paragraph name field.
- Optionally fill in the End paragraph name and Comment fields.
- Specify the extraction location: Closest
valid location or At the end.
- 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.
- If you want to generate a list of input and output variables
for the extracted paragraph, select the Generate paragraph
comments check box.
- If you want to force a preview of the refactoring before
the new paragraph is inserted, select the Force preview check
box.
- Optionally (or necessarily, if you selected Force
preview), click Preview. The Extract Paragraph wizard compares
the original source with the refactored source in a preview window.
- If you are in the preview window and want to return
to the previous display, click Back.
- Click OK. The
wizard inserts the extracted paragraph into your COBOL file and exits,
returning you to the editor window.