Rational Programming Patterns

PDP COBOL editor

The PDP COBOL editor provides additional functions to the standard COBOL editor. You can modify the COBOL code while clearly seeing the origin of all the code lines (generated lines, Macro lines, or specific code lines), the deleted or overwritten lines, and the potential problems detected by the reconciliation.

To see the content of this editor, you must have generated an instance. Then, in the Design Explorer view, right-click the corresponding .cbl file, which contains the generated COBOL. Select Open with > PDP COBOL editor.
Tip: You must be familiar with the concepts explained in The steps to generate the COBOL of a Program, Screen, or Server before you read this help.

Modifying the generated code

You can modify the generated code to adapt it to your particular needs.

Important: The COBOL syntax check is disabled for all the instances whose type of COBOL code (indicated on the Definition tab) is not an IBM type.
Tip: On the lines that contain characters after the column 72, these characters are shifted to the right when you insert text/code before the column 72. If you want these characters to retain their initial position, select the choice Manage Sequence Numbers in the menu Window > Preferences > COBOL > Editor > Sequence Numbers.

You can use micropatterns or snippets to insert code. It is strongly recommended not to modify the code that is generated by a micropattern. Warnings in the margin indicate where the insertion of specific code can disrupt the reconciliation (overriding a line that is generated by a micropattern and adding a micropattern call in the specific code that is generated by a micropattern).

You can insert functions or subfunctions in the PROCEDURE DIVISION by using a creation wizard. To open it, right-click in the editor and select Create a function or subfunction. The cursor position when you open the wizard is irrelevant. The new function or subfunction is correctly inserted according to the number you give it in the wizard.

Two insertion types are possible:
  • Insertion in absolute mode in Programs, Screens, and Servers,
  • Insertion in relation to the automatic functions of the Standard or client Dialog model.
The following elements are inserted in the code:
  • A title for a function or a comment for a subfunction,
  • The start and end tags,
  • The level,
  • The comment *<insert code for Fffnn here> (with Fffnn as the function or subfunction code) to indicate the possible beginning of a specific code insertion,
  • Information that varies according to the insertion:
    • For an insertion in absolute mode: the execution condition if it was indicated in the wizard.
    • For an insertion in relative mode: the placement relative to the automatic function of the Standard or client Dialog model. The indications *@BEFORE, *@AFTER, or *@REPLACE are displayed at the beginning of the insertion, followed by the category, the Segment, or the Data Element relatively to which the insertion is based. For an insertion in function F80, the customized access is indicated.

You can modify the level of a specific subfunction from the subfunction creation wizard. To do it, put the cursor in the subfunction, right-click, and select Change the level of a subfunction.

The PDP COBOL editor includes many functions. For example, you can cut, copy, paste, filter the lines, debug, compare, and display the content assist by pressing the Ctrl and space keys.
Limit: The Undo and Redo functions of the editor are no longer available after a generation. The pile of changes to Undo/Redo is emptied after each generation. The changes that are made before a generation cannot be undone with the Undo function. To delete changes (including the generation) made before the generation, you can exit the editor without saving or use the Revert File function.

The PDP COBOL editor indicates a modified state with a * in the tab title of the editor when the edited .cbl file is directly modified or when one or more referenced design files are modified. When you modify an instance (a Data Element for example) referenced in the edited COBOL file, the PDP COBOL editor displays a modified state. To undo the changes in the editor and in the model instances, right-click and select Revert File.

Desynchronization between the design and the generated code

When the design of the generated instance is modified, the generated COBOL can no longer be synchronized. In this case, the icon Desynchronization between the design and the generated COBOL is displayed, followed by a special character, in the title of the PDP COBOL editor tab. The default special character is > but you can change it by selecting Window > Preferences > Pattern Driven Programming > PDP Framework > Character to use to better visualize the need for regeneration in the PDP Editor. These signals alert you that a new generation is needed.
Note: The desynchronization is also indicated in the Design view of the instance. The color of the generation button changes (Generate is recommended) to inform you that Generate is recommended due to modifications in the design. When the generation is complete, the synchronization is restored and the button returns to its initial appearance.

Specific display in the editor

The specific changes are emphasized by a specific color (which you can change by selecting Window > Preferences > COBOL > Editor > Text Editors ). For example, a DATE-COMPILED line might be colored because the date from the Pacbase source is different from the data of the local generation. If you do not decide otherwise, the line from Pacbase is kept.

The PDP coloring, on top of the COBOL editor coloring, identifies the origin of the lines.

You can change these PDP default colors by selecting Window > Preferences > Pattern Driven Programming > Pacbase Patterns.

Two symbols might be displayed in the margin:
  • Information is displayed if code lines were deleted or overwritten. If you place your mouse over this symbol, you can see the deleted line or the line overwritten by the current line.
  • Warning is displayed by the reconciliation (the process that integrates, after a generation, the new design of an instance with the user-specific changes) on each line where it has detected a potential problem. Such a problem occurs, for example, when the reconciliation is not sure where it must place the specific code because several locations are possible, or when the overwritten generated code has changed.
You can change the view in the PDP COBOL editor with filters from the Generated Code Structure view. You can also use the contextual menu of the editor to carry out the following actions:
  • Unfold all the blocks by right-clicking and selecting Expand all blocks.
  • Collapse all the blocks by right-clicking and selecting Collapse all blocks.

Terms of use | Feedback

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