BTACH Debug

5 pts.
Tags:
AS/400
AS/400 batch job
AS/400 debugging
How to debug the the Batch JOb without holding it i.e SBMJOB with HOLD(*NO)

Software/Hardware used:
AS400
ASKED: October 7, 2009  3:54 PM
UPDATED: October 9, 2009  2:35 PM

Answer Wiki

Thanks. We'll let you know when a new response is added.

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

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following