Top
NetCOBOL V11.0 Debugging Guide
FUJITSU Software

5.3.2 Trace Information

The TRACE function writes the statement numbers of COBOL statements that were executed, up to abnormal termination, as trace information.

Number of Trace Information Items

When compiler option TRACE is specified without specifying the number of information items at compile time, up to 200 trace information items are produced.

If one run unit contains two or more COBOL programs which had the TRACE option specified, the number specified with the TRACE option for the program that is activated first will be used.

To change the number of trace items to be generated, use the execution-time option r. The TRACE function can also be suppressed by specifying execution time option nor. Refer to "Format of Runtime Options" in the "NetCOBOL User's Guide" for the detail.

Note

Zero cannot be specified for the number of trace information items.

Trace Information Storage Destination

Trace information is stored in files specified in the environment variable information @CBR_TRACE_FILE. Refer to "@CBR_TRACE_FILE (Specify the trace information output file)" in the "NetCOBOL User’s Guide".

If the environment variable information @CBR_TRACE_FILE is not specified, trace information is stored in files named after the executable file with the extensions TRC and TRO.

The trace information is always stored in a file with the extension TRC. When the number of stored information items reaches the specified count at compilation or execution, the contents of the file with the extension TRC are converted to a file with the extension TRO.

Examples of trace information storage file names that are assumed when the environment variable information @CBR_TRACE_FILE is specified and when it is not specified are provided below.

Example

If C:\PROG1.TRC is specified in the environment variable information @CBR_TRACE_FILE

  • Trace information storage destination (current information): C:\PROG1.TRC

  • Trace information storage destination (information on the previous generation): C:\PROG1.TRO

If the environment variable information @CBR_TRACE_FILE is not specified

  • Executable program storage destination: C:\PROG2.EXE

  • Trace information storage destination (current information): C:\PROG2.TRC

  • Trace information storage destination (information on the previous generation): C:\PROG2.TRO

Output Format of Trace Information

The output format of trace information is shown below.

										NetCOBOL DEBUG INFORMATION   DATE 2007-07-04 TIME 11:39:22
                                                           PID=00000123 (1)
TRACE INFORMATION                                                           
(2)        (3)                 (4)                   (5)             (6)
1 External-program-name [Internal-program-name] Compilation-date   TID=00000099
2            (7) 1100.1 TID=00000099
3              1200.1 TID=00000099
4              1300.1 TID=00000099
5    (8)       1300.2  (9)          (5)    
6 Class-name [Method-name] Compilation-date TID=00000099
7              2100.1 TID=00000099
8              2200.1 TID=00000099
9     JMPnnnnI-x xxxxxxxxx xx xxxxxxxxx.	          (10)                      
10       THE INTERRUPTION WAS OCCURRED.PID=00000123,... (11)
11       EXIT-THREAD TID=00000099                       (12)
:

Trace Information File

The trace information file of each process is output. In order to prevent overwriting the results of each run with trace, change the name of the trace output file each time you execute the same program.

When the trace information file name of each process is changed, the environment variable information @CBR_TRACE_PROCESS_MODE is specified.

Refer to "@CBR_TRACE_PROCESS_MODE (Unique file name for each Trace file output)" in the "NetCOBOL User's Guide" for the detail.

An example of the file name when @CBR_TRACE_PROCESS_MODE is specified is shown below.

Example

When the environment variable information @CBR_TRACE_PROCESS_MODE is specified

Executable file name:SAMPLE.EXE
Process-ID:00000EC4
Execution date:12/1/2010
Execution time:10:48:50

The newest trace information file name is :

SAMPLE-00000EC4_20100112_104850.TRC

The older trace information file name is :

SAMPLE-00000EC4_20100112_104850.TRO