File Tracing

File tracing is always available. Programs don't need to be compiled with the debug options to use file tracing. File tracing can be especially helpful in assessing the cause of a problem. File tracing provides valuable information about file OPENs, READs, and WRITEs. File status codes for unsuccessful I/O operations are also shown, and configuration variable settings can be examined. For relative files, file trace includes record numbers.

To enable file tracing, type:
runcbl -dlxe errfile myprog

where:

-d turns on the debugger.
-l (optional) causes the contents of the runtime configuration file to be included in the error output.
-x causes the runtime system to display the operating system's corresponding error number for file error 30 on the error output. This information may help in determining the problem.
-e causes the error output to be placed in the file named immediately after the option.
errfile is the user-specified name of the error file. This file is opened as an empty file when the runtime is initiated. Do not forget to specify the error file name -- if you run with -e, immediately followed by your program name instead of an error file name, our object code file will be deleted and opened as a n empty file.
myprog is the name of your object code file.
After you press Enter you are at the debugger screen. To turn on file tracing, type:
tf [#]

File trace is echoed on the screen.

Some file systems can print extra information if a higher level of tracing is enabled. This extra information is useful primarily to Product Support, and they may ask you to execute a tf # for some integer.

File tracing can also be enabled with the FILE_TRACE runtime configuration variable. Some attributes of trace output can be tailored with the TRACE_STYLE configuration variable. For more information about both of these variables, see Appendix H. Configuration Variables.

If you are writing to an error file, you can execute this debugger command:

   t  flush  

to cause the error file to be flushed to disk after each write. This can be useful if your program terminates unexpectedly. It allows the error file to contain everything that the runtime sent to it. Without this command, the error file could be empty following an unexpected program termination, even though a great deal of information had been written to it. Note that this option slows down the processing but ensures that the error file is complete.

To start the program, enter:

   g  

Proceed until you encounter the error condition and then exit. Your error file contains the error information, all COBOL configuration file variables that you have set, and a record of every file operation.