Debugging Jol Macros
To make developing Jol code a little easier, the following may be helpful.
Having two TSO sessions open at once is useful - one can be editing the Jol code, and the other executing it immediately after the code has been changed. After saving the changes, it is a just a matter of pressing enter on the screen running Jol to immediately test the code again. Typically, there is no need to start Jol aagain as it will still be executing in the other session. Not that the Windows or Linux versions act differently from the Mainframe version because they read a macro once, and hold it in storage.
Some instructions such as LISTSYMS will prove useful at ceratin places in your code development, too. LISTSYMS will immediately display all the Symbolic Variables on the screen so that you can see any changes in the variables. Similarly, the WRITE instruction may be used to display the contents of a variable, and a READ will halt the process so that you can see the variable contents.
The instruction JOLOPT TRACE ON will print each instruction to the Jol listing file. You can browse the output listing by looking at the $$JOL.LIST (?) file. Or you can start the Jol Command Processor with the PRINT(*) option to see the result on the screen.
The Jol instruction JOLOPT PM PE will instruct Jol to print each macro (PM) and it's expanded code (the PE option).