Which steps do you want? There are at least four different procedures that I can think of. What OS version is on your server? And is the job running ILE or OPM programming? — Tom
We are using V5R4 OS. And the program is a OPM.
I can’t recall the last time I debugged an OPM program in batch, and I don’t think I’ve ever started debug on an active batch OPM program. I only recall letting the job start after setting up for it. Maybe that’s because I haven’t done OPM programming in the past 15 years or so. If I had to, my first step would be to recompile for ILE.
Nobody else has responded yet; but if anyone else knows how to start debug on an active OPM program, they can add more useful comments than I can give. The system debugger can handle OPM programs; but I just haven’t run across getting into an active one. ILE has the Service Entry Point capability, and OPM just doesn’t have enough info to create one.
I’m not sure which steps you want, so I’ll give a basic series that I ran through the last time I ran a debug over a running batch job. It might help show why recompiling for ILE can be useful.
First, I started the debug manager on my workstation, and then I ran STRDBG in an emulator session. (see http://www.ibm.com/developerworks/ibmi/library/i-debug/index.html ) I named the program to debug on the STRDBG command.
When the debug window opened on my workstation, I clicked the source line that I wanted to set with a breakpoint. I set the break property to be a Service Entry Point.
A few seconds later, the active batch job reached that instruction. A window opened on my workstation asking if I wanted to debug that job, and I clicked the ‘Yes’ button. A second debug window opened showing the source of the program and the breakpoint line highlighted. I selected a variable that I wanted to ‘Watch’ and added it as a monitored variable.
Then I clicked ‘Resume’ and let the job cycle through. The functions that I clicked from there depended on what I wanted at the time.
I never debugged an active job as well. I have always compiled the job with the debug view set to *SOURCE. Then followed what Tom mentioned. Start a debug session then start the program. You can use either STRDBG or STRISDB depending on how you want to debug the program. My only concern is debugging an OPM program is a possibility the object was created with out the ability to run debug ?