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 it takes 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.
    Note: The Design view is deprecated. It will be removed in a future version.
  • Its generated nodes in the Generated Code Structure view. In this view, you can easily browse through the code that is displayed in the PDP COBOL editor. You can 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 modify the design of an instance whose code contains specific code. After a new local generation, the newly generated code includes the code that is produced by the generation of the design. The code that is produced by the generation of the specific insertions is kept. Moreover, the specific code lines are automatically moved to fit the new design at best.

The inconsistencies, if any, are listed in the PDP COBOL editor and 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, you can indicate specific changes by inserting micropatterns, which are microgenerators, from the Snippets view. 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.

You can compare the .cbl COBOL files of Programs, Screens, or Servers in a compare editor or in batch mode.

You can detect the COBOL files that are not in phase with the corresponding design from The Generation Manager view or the rpp --analyzeRegeneratedFiles command. From this command, you can also detect the COBOL files that are desynchronized, erroneous, or the orphan metadata files.


Feedback