Generated Code Structure view

This view displays a hierarchical tree with the generated nodes of the instance. You can use it to easily navigate in the PDP COBOL editor and spot where specific code was entered. Moreover, if you modified the design of an instance that contains specific code, you must consult this view after each new generation. This view shows whether the reconciliation (which integrates the new design while keeping the specific code) has detected any potential problems. Finally, you can use this view to manage the specific functions that are already inserted.

To see the content of this view, you must have generated a Program, Screen, or Server. Then, from the Design Explorer view or the result view of a local or server instance or reference search, open the generated file by right-clicking it and selecting the PDP COBOL editor. For example, for a Program generated file, select Open with > PDP COBOL editor in the contextual menu of the generated Program. The editor must remain opened and currently selected.

In the Pacbase facet, the nodes correspond to functions, subfunctions, sections, and divisions. By default, the tree displays the titles of the generated and specific functions and subfunctions. These titles are extracted from the comment that precedes the function or subfunction. Only the relevant characters are recognized. Characters such as *, +, or =, and the NOTE character string are not included in the titles. If you do not want to display the titles of the functions and subfunctions, clear the option Display the long labels of the nodes from Window > Preferences > Pattern Driven Programming > PDP framework.

The hierarchical tree displays the following symbols:
  • Generated code if the text block that represents the node is generated.
  • Reformatted code if the text block that represents the node contains specific changes: if the generated code was modified, if code was added or deleted. The following symbols specify the type of specific change:
    • Modified code is displayed where you modified the text of the node and no error was found by the reconciliation.
    • Added code is displayed where you added a block of text in the node or created a specific node.
    • Deleted code is displayed where you deleted the whole text of the node (if you deleted only part of it, it is considered as a modification).
    Note: You can perform one of the following actions on each level that contains a warning:
    • Keep the choices made by the reconciliation by right-clicking the node and selecting Remove warnings.
    • Overwrite the text modifications with the originally generated code by right-clicking the node and selecting Restore generated code. The node is then displayed like a generated node. Its block text is displayed with a Generated code symbol.
You can modify the display of the view through one of the following actions:
  • Display only the nodes that represent specific code, and their upward hierarchy. To do so, click Show user code in the toolbar.
  • Filter the nodes. To do so, type a name pattern in the Filters field of the view. To see the whole code again, erase the content of the field.
    Note: You can use the * and ? wildcard characters in the filter string. They are optional at the end of the filter string. You must separate multiple filter strings with commas.
  • Expand or collapse all the tree nodes. To do so, click Expand all or Collapse all in the view toolbar.
  • Display the nodes that are created when the micropatterns that retrieve the parameterized operators in Macros are expanded (Pacbase facet). These nodes are then hidden by default in order not to clutter the nodes tree. However, you can display them to detect problems, if any. To do so, clear the option Hide nodes owning the property "hidden" from Window > Preferences > Pattern Driven Programming > PDP framework.

From a Macro node (Pacbase facet), you can open the Macro in the Macro editor in the context of its call in the Program, Screen, or Server. To do so, right-click a Macro node and select Open the Macro with the Macro editor. Selecting this choice is identical to double-clicking a Macro in the -CP Lines tab of a Program, Screen, or Server.

From this view, you can filter the text in the PDP editor and display or hide parts of the code.

If you right-click a node that represents a function or subfunction written with specific code, you can select the following actions from the contextual menu:
  • Change the level of subfunction : When you select this action, a dialog box prompts for the new level of the subfunction. This action is also available from the PDP COBOL editor.
  • Delete function or subfunction: When you select this action, a dialog box prompts you to confirm the deletion. This dialog box also contains a check box that you can select to request the deletion of all the dependent subfunctions, only if they do not contain generated code. If they contain generated code, this check box is not available.
  • Move the function or subfunction and Copy-paste the function or subfunction: When you select either one of these actions, a dialog box prompts you to enter the new function or subfunction code.
    Restriction: This action is available only on a terminal function of subfunction that does not contain code generated from the design or Macros. To move or copy-paste a group of functions and subfunctions, you must then perform the action on each function or subfunction, one after the other.
It is recommended to use the contextual menu to do these actions because the end tags (Fffnn-FN) of the existing functions or subfunctions that are impacted by the update are automatically reorganized. A manual update requires the manual reorganization of these tags.

If you right-click anywhere in the view, you can select Generate the code in the contextual menu. If you have updated the design of a Program, Screen, or Server, the newly generated code will integrate the changes in the design, while keeping any specific changes in the code.

The preference Structure checking before generation management, which is available from Window > Preferences > Pattern Driven Programming > Pacbase Patterns, checks that the nesting of subfunctions in the COBOL code is correct before the generation. By default, it blocks the generation if structuring errors are detected.


Feedback