PDP COBOL editor

The PDP COBOL editor provides additional functions on top of the functions that are provided by 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. Such is the case if you override a line that is generated by a micropattern and add 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 or Business Component 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. 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 editor tab when the .cbl file is directly modified or when one or more referenced design files are modified. When you modify an instance that is referenced in the opened 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. You can regenerate all the desynchronized files in the Generation Manager view.
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 of the PDP COBOL editor

The PDP coloring, on top of the standard COBOL editor coloring, identifies the origin of the lines. By default, the Macro lines are khaki and the generated code lines are gray.

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

Two symbols that are related to Rational Programming Patterns can 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 that was overwritten by the current line.
  • Warning is displayed in the two following cases:
    • On the lines where the reconciliation detects a potential problem. The reconciliation is the process that integrates, after a generation, the new design of an instance with the user-specific changes. A warning is displayed, for example, when the reconciliation is not sure where it must place the specific code because several places are possible, or when the overwritten generated code has changed.
    • On the lines where a difference is detected between the Pacbase generation and the local generation. The label of this type of warning can be clearly identified in the Problems view.
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 complete 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.

Feedback