Back Issue

TSO TEST in Batch

From time to time, it may be useful to trace program flow through a module in batch mode. The TSO TEST command can be used to do this without source changes or recompiling modules with the TEST option. Sample JCL could look like this: //TRACE EXEC TSOBATCH ..... more JCL here ... //SYSTSIN DD * TEST MY(EDITPGM) + 'TER(UADUMP)/' AT EDITPGM.MAIN.+0 (LIST 0R:15R;LIST 13R% L(72);W 14R%;GO) AT EDITPGM.SUBRTN1.+0 (LIST 0R:15R;LIST 13R% L(72);W 14R%;GO) AT EDITPGM.SUBRTN2.+0 (LIST 0R:15R;LIST 13R% L(72);W 14R%;GO) GO // A TSOBATCH procedure is being used here to invoke TSO in batch. Check "Stupid JCL Tricks" for more details. You need to allocate whatever DD statements the program needs to run. In the example, a run-time parm of TER(UADUMP) is being passed to the program. Breakpoints have been set up in the main routine and two sub-routines to trace entries into those modules. The registers and the current save area are being dumped. The W or WHERE command is being used to identify the return register location. The % symbol indicates a 24-bit address; you would use a ? if 31-bit addresses are in use. Because the program is executing in batch, the GO command is used at each breakpoint to resume execution.

The command string which is invoked at a breakpoint must be less than 255 characters long, however, you can store TEST commands in a member of a CLIST library allocated to SYSPROC and use the member name as the commands to be invoked at a breakpoint. So, for example, if the CLIST member was TRACERTN, the command

AT EDITPGM.SUBRTN2.+0 (%TRACERTN) could be used instead to invoke a series of TEST commands at this breakpoint.


Comments or suggestions can be sent to the author.

Last Month's Topic

Big Iron