To do a batch debug you need the job inforomation.
The system will not generale this until it is on a jobq.
So you have these choices:
1. SBMJOB with HOLD(*YES)
2. Put JOBQ on-hold before submitting job
3. Submit to a different jobq that is not attached to a subsystem, then move job
4. SBMJOB and start the debug as it is running. For a long running job, this may be possible, but you will not get the initial instructions.
********************************************************************************
A simpler way: Find the program (or its source) in RSE. Right-click and “Set Service Entry Point”. Start the batch program. When the batch pgm hits the service entry point, the editor jumps into debug mode and you can monitor the job line by line or by breakpoint. Even correct the source and/or variables on the fly.
Graybeard52
***********
A point to clarify, if you’re using the debugger through the emulation/5250 screens:
You don’t have to wait until the job starts running before entering the STRDBG command. Once your batch job has been submitted on hold, in order to debug it, you first need to run the STRSRVJOB command to identify that your debug commands apply to that specific job, and not the one from which you’re running the debug commands. Once STRSRVJOB has been executed, you can then run STRDBG for the program(s) you want to debug. Don’t attempt to set any break points yet, as the system won’t let you. Press F12 to exit the source view of the program(s) being debugged.
Then, release the batch job. At that point, you’ll get an option on the screen to let the job start running, or to enter debug commands (via the F10 function key). After pressing F10, in order to access your source in order to set breakpoints and such, run the DSPMODSRC command. Once the desired break points have been set, just back out to the prior screen from where you pressed F10. At that point, press Enter, and the job will start running and pause on your first break point. From there, you can step through the code as in a regular debug session.
This method will work for either ILE or OPM programs (as long as they have been compiled with the appropriate debug options). A slight drawback of debugging through RSE in WDSC is that it will only work for ILE programs.
CWC
——————-
Discuss This Question: 4  Replies