R.otto
450 pts. | Jun 30 2009 7:10AM GMT
First you must compile the program with: DBGVIEW(*LIST).
If it is an interactive program you can run STRDBG and then either call the program directly or start the job in which the program is called.
If it is a program that runs in batch it gets more complicated:
1. Hold the job queue where the program will be submitted
2. Submit the job
3. Hold the submitted job
4. Release the jobq, and if required change the jobq.
5. Start servicing the submitted job using STRSRVJOB JOB(number/user/name) (Start Service job), where “number”, “user’ and “name” are attributes retrieved from the submitted job.
6. Start the debugger using STRDBG PGM(library/program) UPDPROD(*YES) (Start Debug)
7. You are now in the display module source. Don’t try to debug or add breakpoints. It’s too early. The job must be active before. Leave this screen using F12.
8. Release the held job.
9. When the job is activated, the start service job window comes. Use F10 to enter debug command.
10. Use DSPMODSRC (Display module source) command to go back to the source and add breakpoint wherever you want, using F6
11. Use F12 to resume the job, and F12 once again to go back to the start service job window.
12. Use Enter to launch the job.
13. The process breaks at the first breakpoint installed and gives you the control.
14. Debug….my friend
15. When the job is finished, you receive a ‘Job being serviced ended’ message.
16. Use ENDDBG command to end debug.
17. Use ENDSRVJOB to end servicing
That’s all!






