|
After you successfully create and run an SPL routine, you can encounter logic errors. If the routine has logic errors, use the TRACE statement to help find them. You can trace the values of the following items:
To generate a listing of traced values, first use the SQL statement SET DEBUG FILE to name the file that is to contain the traced output. When you create the SPL routine, include a TRACE statement.
The following methods specify the form of TRACE output.
Figure 10-107 demonstrates how you can use the TRACE statement to monitor how an SPL function executes.
Figure 10-107
With the TRACE ON statement, each time you execute the traced routine, entries are added to the file you specified in the SET DEBUG FILE statement. To see the debug entries, view the output file with any text editor.
The following list contains some of the output that the function in Figure 10-107 generates. Next to each traced statement is an explanation of its contents.