Version 4.2.6 for Mainframes (Update)
 —  Debugger  —

Statement Execution Statistics Maintenance

This function is used to obtain statistical information on which statement lines of invoked Natural objects were executed. The function also provides information on how often an object was invoked and how often a statement line was executed.

Statement execution statistics can be used for the following purposes:

Start of instruction setTo invoke the statement execution statistics maintenance function

The functions provided in the Statement Execution Statistics Maintenance menu are explained in the following section whereas all print functions are described in Print Statements.


Set Test Mode ON/OFF

See the section Switch Test Mode On and Off.

Top of page

Set Statement Execution Statistics ON/OFF/COUNT

This function is used to activate statistics about executed statement lines of Natural objects.

This section covers the following topics:

Setup Options

When executing a Natural object with statement execution statistics set to ON or COUNT, all statement lines executed within a specific object are listed in a statistical report.

With the option ON, the debugger only retains whether a specific statement line was executed or not; with the option COUNT, it counts how often a statement line was executed. You can specify a library and an object name to restrict statement execution statistics to the desired Natural objects. The default is to collect statistics for all objects of the current library. Asterisk (*) notation is possible.

If you switch statement execution statistics from ON to COUNT or vice versa, existing statistics are not affected, that is, their status of ON or COUNT remains.

The statistical data collected is stored in the debug buffer. The amount of storage that is required to store statistical information for a Natural object is approximately

(number of source lines) / 8 + 100 bytes with statement execution statistics set to ON and
(number of source lines) * 4 + 100 bytes with statement execution statistics set to COUNT.

If you modify a Natural object by inserting or deleting lines and you do not renumber the object lines before you STOW it, the amount of storage required for the object's statistics may increase. To avoid this, set Auto Renumber to Y (Yes) in your editor profile (see Editor Profile in the Editors documentation), or use the system command CATALL (see the System Commands documentation) with the Renumber source-codes lines option enabled (this is the default).

You can use the debugger command PROFILE (see Navigation and Information Commands) to limit the size of the debug buffer. With statement execution statistics set to COUNT, no statement execution statistics are collected for objects with more than 8000 statement lines.

Statement execution statistics are part of the debug environment; therefore, they are affected by the direct commands SAVE ENVIRONMENT and LOAD ENVIRONMENT (see also the section Debug Environment Maintenance).

Activate and deactivate Statistics

This section provides instructions for activating or deactivating statement execution statistics.

You can specify a library and/or an object name to restrict statement execution statistics to the desired Natural objects. The default is to collect statistics for all objects of the current library. Asterisk (*) notation is possible.

Start of instruction set To activate statement execution statistics

If you do not specify a library and/or an object, the statistics data about all objects in your current library are activated.

Start of instruction setTo deactivate statement execution statistics

If you do not specify a library and/or an object, the statistics data about all objects in your current library are deactivated.

Top of page

Delete Statement Execution Statistics

Start of instruction setTo delete statement execution statistics

If you do not specify a library and/or an object, the statistics data about all objects in your current library are deleted.

Top of page

Display Statement Execution Statistics

This function invokes a screen with a list of the specified statement execution statistics.

Start of instruction setTo invoke the List Statement Execution Statistics screen

  1. In the Statement Execution Statistics Maintenance menu, enter function code D.

    Or:
    Enter the following direct command:

    DISPLAY XSTATISTICS

    The List Statement Execution Statistics screen is displayed:

    16:02:01              ***** NATURAL TEST UTILITIES *****             2002-02-15
    Test Mode ON        - List Statement Execution Statistics -     Object 
                                                                                All
    Co Object   Library  Type        DBID   FNR Obj.Called Exec Exec   %  Total No.
       *_______ *_______                           n Times able uted     Executions
    __ TEST     SAG      Program       10    32          4   20   17  85         95
    __ MAP01    SAG      Map           10    32          6    2    2 100         12
    __ SPGM02   SAG      Subprogram    10    32          2    6    2  33          4
    __ SAGTEST1 SAG      Program       10    32          2   20   10  50         17
    __ DEBPGM   SAG      Program       10    32          1    6    6 100         34

    For each object, the following information is displayed:

    A list entry is highlighted if data is missing or possibly inconsistent.

  2. On the statistics list, you can mark an item with a line command for further processing:

    Line Command Explanation
    DE Deletes statement execution statistics as described above.
    DS Displays all statement lines.
    DX Displays executed statement lines only.
    DN Displays non-executed statement lines only.
    I Displays information on the cataloged object and errors.
    PS Prints all statement lines.
    PX Prints executed statement lines only.
    PN Prints non-executed statement lines only.

    For further information on print functions, see Print Statements.

The following section describes the screens, which can be invoked with the display commands:

Display All Statement Lines

The Display Statement Lines screen shows the object source and indicates whether or not a statement line has been executed.

Start of instruction setTo invoke the Display Statement Lines screen

If no unique object has been specified, the List Statement Execution Statistics screen is displayed.

Display Executed Statement Lines

The Display Executed Statement Lines screen corresponds to the Display Statement Lines screen, but only the statement lines that have been executed are displayed.

Start of instruction setTo invoke the Display Executed Statement Lines screen

Display Non-Executed Statement Lines

The Non-Executed Statement Lines screen corresponds to the Display Statement Lines screen, but only the statement lines that have not been executed are displayed.

Start of instruction setTo invoke the Display Non-Executed Statement Lines screen

Top of page

Print Statements

With the print functions, you can directly route a generated list of statement execution statistics to a printer or download the list to a PC. You define a printer as the output device on the User Profile screen of the debugger. Use the debugger command PROFILE (see the section Navigation and Information Commands) to invoke this screen.

If you do not specify a library name, the library where you are currently logged on is assumed by default.

As indicated under Print Options below, to invoke one of the print functions, you can either enter a function code in the Statement Execution Statistics Maintenance menu, enter a line command on the Display Statement Lines screen, or enter a direct command.

Print Options

Print Function Function Code Line Command Direct Command
Print statement execution statistics 1   PRINT XSTATISTICS library (object)
Print all statements 2 PS PRINT STATEMENT library (object)
Print executed statements 3 PX PRINT EXEC library (object)
Print non-executed statements 4 PN PRINT NOEXEC library (object)

See also the syntax of PRINT in the section Command Summary and Syntax.

Related Topics:

Top of page