There is a VERY important sentence in Douglas’s last post:
“The debugger is intended for interactive use.”
The idea behind watchpoints and breakpoints is to STOP the execution of an object, look at variable values, think about what is happening and why it happened. Reading a series of printouts doesn’t come close to being as useful for debugging.
Many long time Natural programmers, myself included, debug batch programs by running them online. How? Easy.
If there is only one workfile involved, I typically STACK a bunch of records. Then, instead of a READ WORK FILE, I use an INPUT. If there are more work files involved, I use a subprogram. Instead of a READ WORK FILE, I use a CALLNAT which returns the next “record”. Instead of a WRITE WORK FILE, write to an array, and at the end of what would be a job step, write out the array.
This gives you the benefits of working with the debugger as it was designed to work, interactively. It also gives you the ability to reliably simulate the operation of work files.
Try it. You will never want to go back to using the debugger in batch.