Natural Program Structure

The Natural Program Structure tab shows the subroutines and includes found in the Natural programs in the current project.

To display the Natural Program Structure tab, go to Explore Projects tab and select Natural Program Structure from the Usage in Programs list of analyses to the right of the screen.

The central part of the screen displays the list of attribute filters. By default, all attributes are selected; deselect the ones that you do not want to use. The breadcrumb displays the selected projects, the selected attributes together with the filters set for each attribute.

Important:
In AD Analyze, an external subroutine from a Natural file is treated as a program when it exists independently within a Natural program file and when it can be called from any other Natural program, except the one where it has been defined.
Note: Make sure that the external subroutine's name is unique within the application library.
An external subroutine has the following structure:
  • Data Definition (optionally)
  • Control logic (where the control logic is coded as a subroutine, e.g. starts with DEFINE SUBROUTINE and ends with END-SUBROUTINE)
  • End Statement
Note: The control logic for external subroutines may contain multiple subroutine definitions nested within and should not have other logic outside subroutine's definition section.

Only in this case, an external subroutine will be treated as a program.

Therefore, the Natural Program Structure tab shows the subroutine name prefixed with the module name. Example:
module:ExternalSubroutine
Click the Filter field to the right of an attribute name and enter the filter that you want to use for the attributes' names. After you press Apply, only the elements that match the name filter are displayed in the Results area. Special characters can be used. For example:
  • "*" is used to search elements, by adding to it either prefixes or suffixes as follows:
     "AAA*" or "*AAA"
    or
    "module*" or "*ExternalSubroutine" 
  • "," is used to search multiple elements as in "AAA, BBB, CCC, module:ExternalSubroutine1, module:ExternalSubroutine2"
  • "module:ExternalSubroutine" is used to directly search the name displayed in the list
Note: The special characters "*" and "," cannot be used simultaneously.

To limit the number of attributes of a certain type that are returned by the filtering operation, use the fields in the Limit column. The default limit is 10; the maximum limit can be set in the corresponding Usage Settings section from the Preferences dialog. For more information, see Natural Program Structure Settings. The Context column displays the context of the filter operation where relevant. To the right of Attribute filters area, the list of projects is displayed.

Use Save to save the current filter configuration. Use Load to load a previously saved filter configuration.

By default, Enable levels limit is selected and the number of elements that are presented in the Results area is limited by the values set in the Limit column. If you deselect this option, the Limit column from the Attribute filters area disappears and the Results area displays all the results of the analysis. Press Apply to apply the selected filters. When the filtering operation is finished, you can use the black arrow button in the upper left corner of Attribute filters area to hide it and maximize the Results area. To see the Natural Program Structure parameters in a separate tab, use the arrow button in the upper right corner of the Natural Program Structure tab.

The results of the filtering operation are displayed in the Results area. Use the search field to locate a specific element in the Results tree. Click the adjacent button find only annotated to filter the search results so that only the annotated elements are shown. In the upper right corner of the Results area, the following buttons are available.

Expand top 2 levels, click this button to expand the top two levels of the tree.

Collapse all, click this button to fold all the tree branches.

Export Results to CSV File, use this button to export the results together with the used filter configuration.

Place the mouse cursor over a node in the tree to display a tooltip that presents the element category and name. When you select a tree node, the area to the right of the screen is updated to display the graphs, reports, and usage analyses that can be generated for the selected element. Also, the Properties view displays the information available for the selected element.

In the tree, double-click an element to open the corresponding file at the occurrence line. The following nodes are available.
Table 1. Natural Program Structure Tab nodes
Node name Description
Program Shows the tree for a Natural source file. The tree contains nodes for subroutines and include files.
Subroutines Opens the source file at the relevant subroutine.
Includes Opens the source file at the include statement.

Node pop-up menu

Select a node from the tree in the Results area then right-click to display the pop-up menu. The number of options available depends on the type of node selected. View analysis source and Copy options are available for all nodes. According to the selected node, several Collapse to … Level options might also be available.