Managing the COBOL code

You can modify the code by adding specific changes. You can also modify the design from a design editor and generate again. The generation always keeps your specific code, while taking all the design modifications into account. This process is called the reconciliation.

To display the generated code, right-click the .cbl file of a Program, Screen, or Server in the Design Explorer view or the result view of a local or server instance or reference search, and select Open with > PDP COBOL editor.

You can then see the following elements of the instance:
  • Its generated code in the PDP COBOL editor. This editor complements the functions that are already provided by the standard COBOL editor and makes it easier to modify the code.
  • Its design, in a read-only mode, in the hierarchical tree of the Design view. To modify the design, you must open the appropriate design editor
  • Its generated nodes in the Generated Code Structure view. You can use this view to easily navigate in the code that is displayed in the PDP COBOL editor, spot where specific code is inserted, and accept or reject the choices that are made by the reconciliation. You can also use this view to manage the specific functions and subfunctions that are already inserted.
The PDP COBOL editor differentiates the generated code from the specific code. From the design editors, you can then modify the design of an instance that contains specific code. After a new local generation, the newly generated code will take into account the code produced by the generation of the design, and will include the code produced by the generation of the specific insertions. Moreover, the specific code insertions will move to fit the new design at best.

All the inconsistencies, if any, are listed in the Problems view.

If the generated code does not fully fit your needs, you can modify it. You can insert code, delete, or overwrite parts of this code. The changes that you make are called specific changes.
Note: In the PDP COBOL editor, some micropatterns and snippets, which are microgenerators, make it easier to enter some specific changes. Moreover, a wizard for the creation of functions and subfunctions simplifies insertions in the PROCEDURE DIVISION.
When you enter a specific change in the PDP COBOL editor, this change is immediately visible in the Generated Code Structure view. Save the new code. If you want to restore the originally generated code, open the Generated Code Structure view and select Restore generated code in the contextual menu. PDP then recognizes that the code corresponds to a generated code.

You can change the design of a Program, Screen, or Server to specify enhancements or correct bugs. You must modify the design from the design editors, and generate the instance again to trigger the reconciliation. Then, you must open the Generated Code Structure view to see whether errors or warnings are flagged by the reconciliation. You must correct the errors, and deal with the warnings by validating or rejecting the choices that are made by the reconciliation.

Note: An instance can be opened in several editors simultaneously. You can modify it in one of these editors. The modifications that are made in this editor are automatically carried over to the other editors. If you close the editor without saving, the modifications are not lost because they are held by the other editors. When you close the editor, a message informs you of this behavior. The modifications are discarded only when you close the last editor without saving.

The Design view is not an editor but a viewer. So, this behavior does not apply. If you modify, in a design editor, the design of an instance that is involved in a generation while the Design view of the generated instance is opened, you can subsequently close the design editor without saving. The modifications are discarded in the design editor and disappear from the Design view.


Feedback