IBM Support

Debugging ILE Programs Submitted in Batch to a Job Queue

Troubleshooting


Problem

This document outlines the procedure for debugging ILE programs submitted for batch execution.

Resolving The Problem

This document outlines the procedure for debugging ILE programs submitted for batch execution. The procedure differs from its OPM counterpart in some steps.

1.Compile program modules using the DBGVIEW(*ALL) parameter. This parameter appears in the following commands:

CRTBNDxxx
CRTxxxMOD

where xxx is the specific programming language: CL, RPG, CBL, C.
2.Submit the program to run in batch:

SBMJOB CMD(CALL PGM(library_name/program_name)) HOLD(*YES)

where library_name/program_name is the ILE program to debug.

The following message is shown:

Job xxxxxx/user_name/QDFTJOBD submitted to job queue QBATCH in library QGPL

where xxxxxx is the job number.
3.Start the service job:

STRSRVJOB xxxxxx/user_name/QDFTJOBD

The job information (xxxxxx/user_name/QDFTJOBD) is taken from the SBMJOB command issued in the previous step. xxxxxx is the job number.
4.Start the debugger:

STRDBG library_name/program_name

The source for program_name will be displayed by the system debugger. Press F12 to exit the Display Module Source screen (attempting to issue debug commands at this point will result in errors, typically MSGCPF1938).
5.Run the following command:

WRKSBMJOB

a Select Option 6 to release the job currently on hold. A Start Serviced Job panel is displayed (pressing the Enter key will cause the job to run to completion).
b Press F10 to display a Command Entry panel. Issue the DSPMODSRC command to display the source for the ILE program being debugged (library_name/program_name).
c Issue debug commands (such as BREAK); cursor and function keys may also be used.
d When done, press F12 to return to the Command Entry panel.
e Press F12 to return to the Start Serviced Job panel.
f Press the Enter key to continue. The Display Module Source panel will be displayed, and the program will stop at the first breakpoint (set earlier).
g Pressing F12 at this time allows the program to continue running (to completion if only one breakpoint was set). Upon program completion, the message, Job being serviced ended (MSGCPF3532), will be displayed.
h Press the Enter key to continue.
6.Exit from debug mode by issuing an ENDDBG command.
7.End the service job by issuing an ENDSRVJOB command.

Note: Alternatively use RDi Debug Service Entry Point

[{"Type":"MASTER","Line of Business":{"code":"LOB57","label":"Power"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SWG60","label":"IBM i"},"Platform":[{"code":"PF012","label":"IBM i"}],"Version":"6.1.0"}]

Historical Number

22750750

Document Information

Modified date:
18 December 2019

UID

nas8N1017457