IBM i job commands let you inspect active work, open a single job, and read its job log. They also control whether a job continues running. Use this page when the problem is clearly work management. It helps you choose the right command before you change a job.
Inspection commands are safe starting points. Commands such as ENDJOB, HLDJOB and RLSJOB change processing and should follow your site’s operating procedure.
Quick command map
| Task | Command | Read-only? |
|---|---|---|
| Show all active jobs | WRKACTJOB | Display is read-only; options can change jobs |
| Work with one job | WRKJOB | Display is read-only; options can change the job |
| Display one job | DSPJOB | Usually read-only |
| Display the active job log | DSPJOBLOG | Read-only |
| End a job | ENDJOB | No |
| Hold a job | HLDJOB | No |
| Release a held job | RLSJOB | No |
Qualified job names
Most commands can identify a job as:
123456/USER/JOBNAME
The three parts are job number, user and job name. Use all three when there can be duplicates. If you know only the name, a work-with display may ask you to select the exact job.
WRKACTJOB
WRKACTJOB is the first screen for active work. It shows jobs by subsystem, status, CPU use, elapsed activity and function.
WRKACTJOB
WRKACTJOB SBS(QBATCH)
Use it to find:
- A job in
MSGW - A batch job using high CPU
- A job stuck in a subsystem
- A job name and number before opening it with
WRKJOB
The display itself is inspection. Options from the display can hold, release, end, change or work with a job. Do not treat every option on the screen as read-only.
WRKJOB
WRKJOB opens a menu for one job. IBM documents options for job status attributes, definition attributes, run attributes, spooled files, job log, call stack, locks, library list, open files, file overrides, commitment control, communications, activation groups, threads and environment variables.
WRKJOB JOB(123456/USER/JOBNAME)
WRKJOB JOB(123456/USER/JOBNAME) OPTION(*JOBLOG)
WRKJOB JOB(123456/USER/JOBNAME) OPTION(*SPLF)
WRKJOB JOB(123456/USER/JOBNAME) OPTION(*PGMSTK)
WRKJOB JOB(123456/USER/JOBNAME) OPTION(*LIBL)
Useful options include:
| Option | Use it for |
|---|---|
*JOBLOG | Messages for the job |
*SPLF | Spooled files created by the job |
*PGMSTK | Call stack |
*JOBLCK | Object locks |
*LIBL | Library list used by the job |
*OPNF | Open files |
*CMTCTL | Commitment control status |
*ACTGRP | Activation groups |
*THREAD | Thread information |
Some options are available only when the job is active. Environment variables for another user’s job can require service special authority.
DSPJOB
DSPJOB displays job information and can be more direct than the work-with menu when you know which view you need.
DSPJOB JOB(123456/USER/JOBNAME) OPTION(*JOBLOG)
DSPJOB JOB(123456/USER/JOBNAME) OPTION(*SPLF)
DSPJOB JOB(123456/USER/JOBNAME) OPTION(*LIBL)
Use DSPJOB for inspection and WRKJOB when you need an interactive menu of choices.
DSPJOBLOG
DSPJOBLOG displays the job log for a job that is active or whose job log has not yet been written as a spooled file.
DSPJOBLOG
DSPJOBLOG JOB(123456/USER/JOBNAME)
DSPJOBLOG JOB(123456/USER/JOBNAME) OUTPUT(*PRINT)
For a job that has ended, the log may be in the job’s spooled files as QPJOBLOG. Use WRKJOB OPTION(*SPLF) or WRKSPLF to find it. The IBM i Job Log and CPF Messages Reference explains how to read the messages.
ENDJOB
ENDJOB asks IBM i to end a job. It is an operational command, not a diagnostic command.
ENDJOB JOB(123456/USER/JOBNAME) OPTION(*CNTRLD) DELAY(60)
ENDJOB JOB(123456/USER/JOBNAME) OPTION(*IMMED)
Use a controlled end when possible. OPTION(*IMMED) is a stronger action and can leave work incomplete. Before ending a job, capture the symptom: status, job log, current function, call stack and locks.
HLDJOB and RLSJOB
HLDJOB makes a job ineligible for processing. RLSJOB makes a held job eligible again.
HLDJOB JOB(123456/USER/JOBNAME)
RLSJOB JOB(123456/USER/JOBNAME)
Holding a job is usually useful for submitted batch jobs that have not started, or for controlling work while an operator investigates. It is not the same as ending a running job.
MSGW triage
When WRKACTJOB shows MSGW, the job is waiting for a message reply.
- Open the job with
WRKJOB. - Display the job log.
- Find the inquiry message.
- Read the message help and earlier diagnostic messages.
- Reply only when the correct answer is known.
Use Troubleshooting an IBM i Job Stuck in MSGW for the full runbook.
Common mistakes
- Ending a job before saving the job log evidence.
- Looking at the current interactive job instead of the qualified batch job.
- Assuming
WRKACTJOBstatus alone explains the root cause. - Replying to an inquiry message from memory instead of reading the message help.
- Using
OPTION(*IMMED)as the normal first response. - Forgetting that work-with displays can perform changes from options.
Read-only inspection checklist
Before changing a job, capture the details that will disappear or change after the action:
| Detail | Command path |
|---|---|
| Current status and function | WRKACTJOB, then note the function column |
| Full job identity | WRKACTJOB or WRKJOB |
| Messages | WRKJOB OPTION(*JOBLOG) or DSPJOBLOG |
| Program stack | WRKJOB OPTION(*PGMSTK) |
| Spooled files | WRKJOB OPTION(*SPLF) |
| Locks | WRKJOB OPTION(*JOBLCK) |
| Library list | WRKJOB OPTION(*LIBL) |
This checklist is especially useful before ENDJOB, because the end action can change the evidence. If a job is waiting for a reply, use the IBM i MSGW troubleshooting runbook before answering or ending it.
FAQ
Is WRKACTJOB read-only?
The initial display is inspection. Options from the display can change jobs, so treat any option that holds, releases, changes or ends work as an operational action.
When should I use WRKJOB instead of DSPJOB?
Use WRKJOB when you want the menu for one job. Use DSPJOB when you already know the exact information view you want to display or print.
Can ENDJOB be undone?
No. You can restart the business process if the application supports that, but the ended job itself is gone. Capture the job log and current state first.
What should I record in an incident ticket?
Record the qualified job name, subsystem, status, current function, message ID, job log timing and the action taken. Those details let another operator reproduce the investigation later.
Summary
- Use
WRKACTJOBto find active work and status. - Use
WRKJOBorDSPJOBto inspect one job. - Use
DSPJOBLOGandWRKJOB OPTION(*JOBLOG)for messages. - Use
ENDJOB,HLDJOBandRLSJOBonly as deliberate operational actions.