This section provides you with some notes/suggestions you should take into account when you use the TRACE function.
Trace information can be collected only for COBOL programs compiled with compiler option TRACE specified.
Figure 5.3 Collecting TRACE information
The TRACE function performs processing other than the processing described in the COBOL program, such as collection of trace information. Therefore, the program size increases and the execution speed deteriorates when the TRACE function is used.
Use the TRACE function during debugging only. When debugging is completed, recompile the program with compiler option NOTRACE specified.
The number of trace information items cannot be set to 0.
When the TRACE function is selected, trace information is generated regardless of whether the program terminated normally or abnormally.
When a program is executed again while a trace information file exists, the contents of the original trace information file will be lost.
When a trace information file is no longer needed, delete the file.
No exception report message may be generated when the TRACE function is used in conjunction with the Debug function of NetCOBOL Studio or the COBOL debugger.
No information is included in a trace information file that identifies a prototype-declared method.
In referencing the statement number of a method, reference the class name and the method name to determine whether the method has been separated by a prototype declaration. With a separated method, the statement number is expressed by the line number of the source file of the separated method, not by the line number of the class definition source file.
A trace information file is output for each executable file processed.
Information cannot be output from two or more processes to the same file at the same time- this will produce an output error at execution time.
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.