Pages

Sunday, November 22, 2015

Debug Batch Job

When you are working with Production Support, You will get a scenario where you would need to debug a job for analyzing unforeseen errors.

Here are few simple steps for debugging a Batch Job.

1. Service the Specific Job by using STRSRVJOB Command.

STRSRVJOB JOB(<Job Number>/<Job User>/<Job Name>)

2. If the Batch Job is currently running, You can check the Call Stack to see what program is currently running.

WRKJOB JOB(000000/JOBUSER/JOBNAM)

Option – 11 to See Call Stack.

3. Start the Debug of the program that is currently running.

STRDBG PGM(TESTLIB/TESTPGM) UPDPROD(*YES)

Job will change to debug mode and will show the source in debug whatever the step that is currently being executed.

If you are submitting a new job and would like to debug it. Below are the steps.

1. Submit the job with HOLD(*YES) parameter on SBMJOB Command. Or, you could consider

HLDJOBQ <JOBQNAME> and Submit the Job.

2. Retrieve the Job Details and Service the Specific Job by using STRSRVJOB Command.

STRSRVJOB JOB(<Job Number>/<Job User>/<Job Name>)

3. Start the Debug of the program that is currently running.

STRDBG PGM(TESTLIB/TESTPGM) UPDPROD(*YES)

4. Release the Job. Press F10 to set break point by going through DSPMODSRC.

No comments:

Post a Comment

Popular Posts