Previous
Previous
 
Next
Next

Sending Output to a Debugging File

When your program contains an error in logic, then the program might execute without producing an error message, but it executes the wrong set of statements or produces incorrect results. For example, suppose you write a Boolean expression incorrectly in an IF statement (for example, you use NE instead of EQ). The program executes the statements you specified, but it does so under the wrong conditions.

To find an error in program logic, you must often see the order in which the statements are being executed. One way you can do this is to create a debugging file and then examine the file to diagnose any problems in your programs by issuing the following DML statements:

  1. Create a debugging file, by issuing an DBGOUTFILE statement.

  2. Specify that you want each program line to be sent to the debugging file when a line executes by setting the PRGTRACE option to YES.

  3. (Optional) When you want the debugging file to interweave the program lines with both the program input and error messages, set the ECHOPROMPT option to YES.


See Also:

The following examples of using a debugging file: