PDA

View Full Version : Debugging RPGIV programs in batch



Guest.Visitor
11-12-2002, 12:21 PM
A team member came to me with this question and it had been nagging me for quite some time so I'm sharing my findings with you all. When you want to debug an RPGIV program in batch it seems impossible but it's quite simple. Follow these steps as outlined: <ul> SBMJOB CMD(CALL YOURPGM PARM('YOUR PARMS')) HOLD(*YES) DSPUSRJOB <enter> Look for the job that is on hold status. Take an option 5. Copy job info: name, number, user or do the remaining steps in another session while referencing the first session. STRSRVJOB JOB(NUMBER/USER/NAME) STRDBG YOURPGM <enter> <F12> RLSJOB JOB(NUMBER/USER/NAME) Or take option 6 from 1st session if you're using two sessions. You'll get a prompt to hit F10 to enter debug commands or hit enter to run the program. Hit F10. You'll get a command line from which you can issue a DSPMODSRC command. The source file will show and you can then enter your breakpoints. hit F12 then F3 to exit the command line prompt. You'll get a prompt to hit F10 to enter debug commands or hit enter to run the program. Hit enter. Happy debugging! [/list] Cliff