Previous Topic Next topic Print topic


TRACELEVEL

Produces a statistical analysis of application behavior by tracing certain operations in native applications. The report produced by this directive provides better readability and is inherently more useful than a traditional ODBC trace.

The the statistical analysis information is written to a logfile named OpenESQLTrace.processID.log, which is created the first time you use TRACELEVEL. With each subsequent use of TRACELEVEL, tracing information is appended to the end of the file. A separator record is written at the end of each trace to help identify different traces.

When you compile with SQL(DBMAN=ADO TRACELEVEL), the statistical analysis is stored in a file named ADOTrace.processID.sessionID.log, where SessionID is in the context of our Multiple Run Unit support. This logfile is created the first time you use TRACELEVEL. With each subsequent use of TRACELEVEL, tracing information is appended to the end of the file. A separator record is written at the end of each trace to help identify different traces.

OpenESQL creates the logfiles under the directory where the application is located. If file/directory permissions prevent file creation in that location, OpenESQL creates the logfiles under the directory referenced in the %TEMP% environment variable.

For information on session IDs, see the topic Multiple User COBOL Applications in .NET.

All trace records contain the elapsed runtime, accurate to one microsecond.

Syntax:

TRACELEVEL={T | 1 | 2 | 3 | 4 | D}

Scope:

Used at compile time: No
Behavior at run time: Source file

See Scope - OpenESQL SQL Compiler Directive Options for more information.

Comments:

  • When TRACELEVEL=T, the following information is written to the trace file:
    • BEGIN - traces main SQL directives
    • END - indicates end of run
    • DIRECTIVES - traces per compilation unit directives the firs ttime acompilation unit is enountered at run time.
  • When TRACELEVEL=1, the following information is written to the trace file in addition to the information written when you speficy TRACELEVEL=T:
    • PREPARE - identifies the original source code when a statement is prepared.
    • DISPOSE - provides summary information for overall statement usage when a statement is removed from the prepared statement cache at disconnect time
    • FLUSH - provides summary information for overall statement usage when a statement is flushed from the cache usually due to a cache overflow
  • When TRACELEVEL=2, the following information is written to the trace file in addition to the information written when you specify TRACELEVEL=1:
    • OPEN
    • EXECUTE - provides the number of rows selected, inserted, or updated
    • EXEC_IMMED EXECUTE - provides the number of rows selected, inserted, or updated
    • ODBCCLOSE - provides summary information for the current cursor use
    • STMT_CHANGED - reports new concurrency and scroll option settings when the ODBC driver uses different settings than those requested by OpenESQL
  • When TRACELEVEL=3, the following information is written to the trace file in addition to the information written when you specify TRACELEVEL=2:
    • ODBCFETCH - provides the number of rows fetched
    • COBOLFETCH - provides the number of rows returned to the COBOL application
  • When TRACELEVEL= 4, the following information is written to the trace file in addition to the information written when you specify TRACELEVEL=3:
    • EXEC_SQL_BEGIN
    • EXEC_SQL_END
  • When TRACELEVEL=D, a reduced version of TRACELEVEL=4 is produced for debugging purposes. It contains only the following information:
    • BEGIN
    • END
    • EXEC_SQL_BEGIN
    • EXEC_SQL_END
    • DIRECTIVES
Previous Topic Next topic Print topic