Managing the generated code

The code that is produced by the generation corresponds to the information that is entered in the instance design. All the properties are replaced with their values. Furthermore, the Static Micropatterns are replaced with the corresponding code lines if these Micropatterns are defined and described. You can modify the code by adding specific changes. You can also modify the design 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 see and modify the generated code, expand the COBOL Program, COBOL Copybook, or Source Code in the Design Explorer view. Right-click the generated file and open the associated code editor:
  • For a COBOL Program, right-click the .cbl file and select Open with > PDP COBOL editor. You will then be able to use all the functions of the PDP COBOL editor and of the Design and Generated Code Structure views. Working on the code will then be made easier.
  • For a COBOL Copybook, right-click the .cpy file and select Open with > PDP COPY COBOL editor. You will then be able to use all the functions of the PDP COBOL editor and the Design view.
  • For a Source Code, right-click the file whose extension is indicated in the called Skeleton. By default, the generated code opens in the Eclipse editor that is associated with the extension of the generated file. However, to modify the code, you must open it in the PDP Source Code editor. To do so, right-click the generated file and select Open with > PDP Source Code Editor.
You can then see the following elements:
  • The generated code in the PDP COBOL editor. This editor complements the functions that are already provided by the standard COBOL editor. It makes it easier to modify the code.
  • The design as a hierarchical tree in the Design view, in a read-only mode.
    Note: This view is empty in the version.
  • The generated nodes in the Generated Code Structure view. You can accept or reject the choices that are made by the reconciliation.
The PDP COBOL and COPY COBOL editors differentiate the generated code from the specific code. You can then modify the design of an instance whose code contains specific code. After a new local generation, the newly generated code takes into account the code from the design generation, and the code from the specific insertions. Moreover, the specific code lines are automatically moved 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. You can insert code lines by calling Static Micropatterns from the Snippets view, RPP SDK Micropattern Snippets category. You can also call micropatterns that were created with the application programming interface.

When you modify the code in the PDP COBOL editor, this modification 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 menu. PDP then recognizes that the code corresponds to a generated code.


Feedback