Call Statistics Maintenance

This function is used to obtain statistical information on which Natural objects were invoked during the execution of an application, and information on how often an object was invoked. Call statistics are deleted after resetting the debug environment.

Beginn der Anweisungsliste To invoke the call statistics maintenance function

  • In the Debug Main Menu enter function code C.

    Oder:
    Enter the following direct command:

    CS

    The Call Statistics Maintenance menu is displayed.

The functions provided in the Call Statistics Maintenance menu are explained in the following section whereas all print functions are described in Print Objects.


Set Test Mode ON/OFF

See the section Switch Test Mode On and Off.

Set Call Statistics On/Off

When executing a Natural object with call statistics set to ON, all calls made to a specific object are counted and the resulting statistics can afterwards be displayed or printed.

Beginn der AnweisungslisteTo set call statistics to ON or OFF

  • In the Call Statistics Maintenance menu, enter function code C to activate or deactivate call statistics.

    Oder:
    Enter one of the following direct commands:

    SET CALL ON

    or

    SET CALL OFF

Anmerkung:
If the call statistics function is switched off and no call statistics have been created or call statistics have been deleted by resetting the debug environment, the information stored for statement execution statistics (see Statement Execution Statistics Maintenance) is used for display. This allows you to detect the non-invoked Natural objects during the execution of an application.

Display All Objects

This function provides an overview of the call frequency of all objects contained in a library.

Beginn der AnweisungslisteTo display the call frequency of all objects in a library

  • In the Call Statistics Maintenance menu, enter function code 1 and a library name.

    Oder:
    Enter the following direct command:

    DISPLAY OBJECT library

    See also the syntax of DISPLAY in Command Summary and Syntax.

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

    A Display Call Statistics screen similar to the example screen shown in Display Called Objects appears.

    The Display Call Statistics screen lists all objects in the specified library and indicates their call frequency in the Calls column on the right-hand side. For each call statement, such as FETCH or CALLNAT, an entry with the name of the object and a counter variable is written into the debug buffer. The counter is then increased for each call of the corresponding object.

Display Called Objects

The screen invoked by this function corresponds to the Display Call Statistics screen, but only the objects that have been invoked are displayed.

Beginn der Anweisungsliste To display called objects of a library

  • In the Call Statistics Maintenance menu, enter function code 2 and a library name.

    Oder:
    Enter the following direct command:

    DISPLAY CALL library

    See also the syntax of DISPLAY in Command Summary and Syntax.

    The Display Called Objects screen appears:

    16:06:53              ***** NATURAL TEST UTILITIES *****             2002-02-15
    Test mode ON              - Display Called Objects -            Object
                                                                                All
    Object   Library  Type         DBID   FNR S/C Ver Cat Date   Time       Calls
    *_______ SAG_____
    MAINPGM  SAG      Program        10    32 S/C 3.1 2002-02-15 11:51          1
    SUBPGM   SAG      Subprogram     10    32 S/C 3.1 2002-02-15 11:50          3
    EMP-PGM  SAG      Program        10    32 S/C 3.1 2002-01-22 11:49          2
    EMPLIND  SAG      Program        10    32 S/C 3.1 2001-08-13 11:18          1

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

Display Non-Called Objects

The screen invoked by this function corresponds to the Display Call Statistics screen, but only the objects that have not been invoked are displayed.

Beginn der AnweisungslisteTo display non-called objects

  • In the Call Statistics Maintenance menu, enter function code 3 and a library name.

    Oder:
    Enter the following direct command:

    DISPLAY NOCALL library

    See also the syntax of DISPLAY in Command Summary and Syntax.

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

For an example screen, see Display Called Objects above.

Print Objects

With the print functions, you can directly route a generated list of call statistics to a printer or download the list to a PC. You specify 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 Call Statistics Maintenance menu, or enter a direct command.

Print Options

Print Function Function Code Direct Command
All Objects 4 PRINT OBJECT library
Called Objects 5 PRINT CALL library
Non-Called Objects 6 PRINT NOCALL library

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

Related Topic:

Example of a PC Download

If Entire Connection and Natural Connection are installed at your site, you can download a statistics list to a PC as described in the following instructions.

Beginn der AnweisungslisteTo download a list to a PC

  1. At session start, specify the profile parameter PRINT as follows:

    PRINT=((1),AM=PC)
  2. After session start, activate the PC connection using the following terminal command:

    %+
  3. Invoke and activate the debugger.

  4. Invoke the User Profile screen by entering the debugger command PROFILE (see Navigation and Information Commands).

  5. On the User Profile screen, in the Output device field, replace the current entry by PCPRNT01 and choose PF3 (Exit) to save the settings.

  6. Activate the call statistics function and execute the application for which you want the debugger to collect statistics data.

  7. From the statistics screen, choose a print function.

    In the Entire Connection window that appears, you can specify the output file and the PC directory.