Reports That Show Natural 4GL Program CPU Usage - Documentation for BMC AMI Strobe 21.01
Two Strobe reports are available that show the CPU usage for Natural 4GL programs and for statements contained in the programs.
Natural Program CPU Usage Summary Report
The Natural Program CPU Usage Summary Report indicates which Natural 4GL programs are responsible for CPU activity. The columns in this report show:
Report Header | Contents |
|---|---|
PROGRAM NAME | Natural 4GL program name or .NATURAL |
LIBRARY | Natural program library name. |
DBID | Adabas database ID for the Natural program library |
FNR | Adabas file number for the Natural program library |
TRANID | If CICS or IMS, the name of the transaction under which the Natural nucleus executed |
% CPU TIME | |
SOLO | CPU activity without any concurrent I/O activity |
TOTAL | CPU activity with or without any concurrent I/O activity |
In this example, Natural 4GL program NATTESTR from program library PRACTICE (identified by Adabas database ID 006, file number 052), running under CICS transaction DIS1, used 92.90% of the total CPU activity. To determine which statements within program NATTESTR were responsible for the CPU usage, refer to the CPU Usage by Natural Program Statement report for program NATTESTR (CPU Usage by Natural Program Statement Report with INCLUDEd Code).
Natural Program CPU Usage Summary report
CPU Usage by Natural Program Statement Report
The CPU Usage by Natural Program Statement report (CPU Usage by Natural Program Statement Report with INCLUDEd Code) shows the distribution of the CPU activity among the statements that make up the Natural 4GL programs. The header information for this report shows:
PROGRAM | Natural 4GL program name. |
LIBRARY | Natural program library name. |
DBID | Adabas database ID for the Natural program library. |
FNR | Adabas file number for the Natural program library. |
TRANID | If CICS or IMS, the name of the transaction under which the Natural nucleus executed. |
RELEASE COMPILED | Release of Natural under which the 4GL program was compiled. |
DBRM | If the Natural program accessed Db2 data using Natural for Db2, the name of the database request module (DBRM) and its creation date. If the Natural program was associated with more than one DBRM, the value of the DBRM field will be MULTIPLE. |
BPNAME | The global buffer pool name, if the name exists. If a local buffer pool is being used, the value of the BPNAME field will be *LOCAL*. |
MODULE, CSECT, PSB | If IMS, the name of the module, CSECT, and program status block (PSB) that initiated the request for IMS DL/I services. |
Each detail line shows:
STMT NUMBER | Natural 4GL statement number. |
SQL STMT | If present, the SQL statement number. The SQL statement number may be suffixed with a Strobe -generated number “-nn”. When activity in Db2 SQL statements causes multiple instances of the same Natural statement number to appear on the CPU Usage by Natural Program Statement report, Strobe indicates the total CPU time used by the Natural statement in a line labeled TOTAL. The spike in the histogram (a row of asterisks and pluses) noting a high proportion of activity, appears next to this line. |
IMS REFNO | The IMS reference number, if the Natural statement accesses an IMS database. |
STATEMENT TEXT | If the program was indexed, the statement text. |
% CPU TIME | |
SOLO | CPU activity without any concurrent I/O activity |
TOTAL | CPU activity with or without any concurrent I/O activity |
Reporting INCLUDEd Code
For INCLUDEd code (often referred to as copycode), an asterisk and a number to the right of the statement number indicates the level of nesting. For indexed copycode in the first level of nesting, Strobe reports statement text along with statement number. For copycode in the second level of nesting and higher, Strobe does not report statement text.
Strobe reports the statement number and statement text of the INCLUDE statement that included the copycode. Strobe then prints the copycode object in-line at the point where it was included. This enables you to identify the copycode object and its statement number that are consuming CPU resources.
For example, statement number 2040 in CPU Usage by Natural Program Statement Report with INCLUDEd Code includes the copycode statement that follows it. The statement that follows 2040 is at the first level of nesting, as indicated by the *1 to the right of its statement number. Located at statement number 0400 in its own program, this statement has the text INCLUDE NATTESTW. It consumes no CPU time but is important because it INCLUDEs the two copycode statements that follow it and enables the user to identify the nested statements that consume CPU time. The statements that follow statement number 0400 have statement numbers 0100 and 0110 in their own programs. Because they are at the second level of nesting, as indicated by a *2 to the right of their statement numbers, Strobe does not report their statement text. The statements at the second level of nesting consume 1.32% and .06% of CPU.
Important
Strobe prints the INCLUDE statement text even if the program is not using indexing and reports CPU activity for the INCLUDE statement even if it is 0%.
Strobe does not index copycode that is nested more than one level because of a limitation of the Natural LIST command, which does not expand copycode beyond the first level.
CPU Usage by Natural Program Statement Report with INCLUDEd Code
Reporting Db2 Information
Strobe for Adabas/Natural can report Db2 information obtained by a Natural for Db2 program.
Programs That Use Natural for Db2
When Natural programs use Natural for Db2 to access data in a Db2 database, Strobe will produce reports that contain both Natural and Db2 information. Strobe for Adabas/Natural will produce CPU Usage by Natural Program Statement reports, and Strobe for Db2 will produce CPU Usage by SQL Statement reports. To obtain in-depth information on SQL statements called by Natural program statements, you can cross-reference the reports: the CPU Usage by Natural Program Statement report contains the DBRM name, its creation date, and the SQL statement numbers associated with the program.
CPU Usage by SQL Statement Report
The CPU Usage by SQL Statement report, CPU Usage by SQL Statement Report, shows the distribution of CPU activity among SQL statements within a Procedure, Query, or DBRM and identifies the target SQL that caused the activity. The description section, which is the top half of CPU Usage by SQL Statement Report, displays SQL statement text for all target statements. The CPU usage section, which is the bottom half of CPU Usage by SQL Statement Report, shows the amount of CPU activity consumed by each executing statement.
In the description section, Strobe lists SQL statements under one of these headings:
- STATIC, NON-CURSOR SQL
- STATIC, CURSOR SQL
- DYNAMIC, NON-CURSOR SQL
- DYNAMIC, CURSOR SQL.
For STATIC, NON-CURSOR SQL statements, Strobe begins each detail line with the precompiler listing statement number followed by statement type. For all other types of SQL statement numbers, Strobe begins each line with a uniquely generated statement number that is based on the sequence in which Strobe detects activity for the statement.
In the CPU activity section of the report, Strobe begins each detail line with the precompiler statement number followed by the verb under the heading STATEMENT TEXT. For SQL verbs with target SQL statements, Strobe then displays the generated statement number and the SQL verb of the target statement.
Cross-Referencing the Reports
To get detailed information about SQL statement activity associated with Natural program statements, cross-reference the CPU Usage by Natural Program Statement report with the CPU Usage by SQL Statement report. To cross-reference the CPU Usage by Natural Program Statement report with the CPU Usage by SQL Statement report, find the CPU Usage by SQL Statement report that corresponds to the DBRM named in the CPU Usage by Natural Program Statement report. Then locate the SQL text identified in the Natural report in the description section of the Db2 report. If Strobe appended the SQL statement number with a dash number, then locate the statement corresponding to this number. Otherwise, locate the statement corresponding to the SQL statement number itself.
You can cross-reference the reports in this way:
- Locate the Natural program statement with high CPU activity. In CPU Usage by Natural Program Statement Report with Db2 Information, this is Natural program statement number 0400.
- Locate the SQL statement number associated with the Natural program statement number. In CPU Usage by Natural Program Statement Report with Db2 Information, this is SQL statement number 1150. Note that the Natural program statement number text is printed the first time the number is printed. For statement 400, this is:
STORE WPACI410-DEMO.
Activity that is not associated with an SQL number, such as the 1.15% for Natural program statement number 0400, is attributable to initialization or other overhead routines.
- Match the DBRM name on the CPU Usage by Natural Program Statement report with the DBRM name on the CPU Usage by SQL Statement report (CPU Usage by SQL Statement Report).
Go to the CPU Usage by SQL Statement report, CPU Usage by SQL Statement Report, and in the description section of the report locate the text of the Db2 statement number. You know to look in the STATIC, NON-CURSOR section because the SQL statement number does not have an associated dash number. For statement 1150, the text is:
INSERT INTO WPACI410.DEMO(NAME,ADDRESS,DATEOFBIRTH,SALARY) VALUES(:H,:H,:H,:H)
- Look in the CPU usage section of the CPU Usage by SQL Statement, CPU Usage by SQL Statement Report. The report shows that statement 1150 is an INSERT statement, which uses 3.45% CPU time.
Natural program statement number 0480 in CPU Usage by Natural Program Statement Report with Db2 Information also uses a significant amount of CPU time. Because this is a different type of SQL statement, the cross-referencing procedure is somewhat different.
- Locate the SQL statement number associated with this Natural program statement number. The SQL statement number is 1187 with an -04 appended to it. The dash number is a uniquely generated Strobe sequence number.
Go to the CPU Usage by SQL Statement report and in the description section of the report, CPU Usage by SQL Statement Report, look up the dash number, which tells you the type of SQL DECLARE statement being used. The report shows that -04 is:
DECLARE C0050480 CURSOR FOR SELECT COUNT(*), NAME FROM WPACI410.DEMO WHERE NAME>=’????’ GROUP BY NAME ORDER BY NAME FOR FETCH ONLY
- To find the SQL verb associated with this statement go to the CPU usage section of the report and look up the base number 1187 and in the second column match the dash number. The statement text tells you that 1187-04 is an WRITE statement.
- Look up the other SQL statement associated with Natural program statement number 480. The CPU Usage by Natural Program Statement report, CPU Usage by Natural Program Statement Report with Db2 Information, indicates that the SQL statement is 1191-04.
- Go to the CPU Usage by SQL Statement report, CPU Usage by SQL Statement Report, and look up 1191-04. The dash number indicates, as seen previously, a DECLARE statement.
- Go to the CPU Usage section of the report and look up 1191 matching the -04 in the second column. This section of the report tells you that 1191 is a FETCH statement.
For more information about the CPU Usage by SQL Statement report and other Db2 reports collected by Strobe for Db2, such as the Transaction Summary, the SQL CPU Usage Summary, the SQL Wait Time Summary, and the Attribution of CPU Execution Time, see the Strobe for Db2 guide.
CPU Usage by Natural Program Statement Report with Db2 Information
CPU Usage by SQL Statement Report