IBM i Command Reference

This page is a task-first index to everyday IBM i commands. It is not a replacement for F4 prompting or the IBM command reference; it is a fast route from the thing you are trying to do to the command family that usually owns it.

Read-only commands are separated from commands that change the system. When a command can end a job, change a library list, delete output, clear a queue, or alter authority, treat it as an operational action and use your site’s change process.

Job and work management

TaskStart withChanges something?Notes
See active jobsWRKACTJOBNo, until you take an optionBest first screen for CPU, status, subsystem and function
Inspect one jobWRKJOB, DSPJOBNo, until you take an optionUse the qualified job name when duplicates exist
See a job logDSPJOBLOG, WRKJOB OPTION(*JOBLOG)NoFor ended jobs, look for the QPJOBLOG spooled file
End a jobENDJOBYesPrefer a controlled end before OPTION(*IMMED)
Hold or release a jobHLDJOB, RLSJOBYesUseful for batch work that has not yet run

For the detailed job command lookup, use the IBM i Job Commands Reference. For a symptom-based runbook, use Troubleshooting an IBM i Job Stuck in MSGW.

Library lists

TaskStart withChanges something?Notes
Display your library listDSPLIBLNoShows the current job’s library list
Add a library to the user library listADDLIBLEYes, for the current jobUse POSITION(*FIRST) or POSITION(*LAST) deliberately
Remove a libraryRMVLIBLEYes, for the current jobThe library must be in the user part
Replace the user library listCHGLIBLYes, for the current jobCommon in job setup CL programs
Edit the list interactivelyEDTLIBLYes, for the current jobLets you add, remove and reorder entries
Change current libraryCHGCURLIBYes, for the current jobAffects unqualified create and lookup behavior

Use IBM i Library List Commands Reference when the problem is library resolution, wrong object found, or a batch job using a different list than an interactive test.

Objects, libraries and members

TaskStart withChanges something?Notes
Find an objectWRKOBJNo, until you take an optionGood for name and type searches
Display object detailsDSPOBJDNoShows owner, type, library, attributes and dates
Check whether an object existsCHKOBJNoOften used in CL with MONMSG
Work with a libraryWRKLIB, DSPLIBNo, until you take an optionUse authority carefully from work-with displays
Work with membersWRKMBRPDM, DSPFDNo, until you take an optionPDM options can change or delete source

Use the IBM i Object and Library Commands Reference for practical lookup patterns.

Spooled files and output queues

TaskStart withChanges something?Notes
List your spooled filesWRKSPLFNo, until you take an optionFilter by user, job, output queue or form type
Work an output queueWRKOUTQNo, until you take an optionShows files waiting on a queue
Display a spooled fileDSPSPLFNoReads the output
Hold or release a spooled fileHLDSPLF, RLSSPLFYesControls whether the writer can print it
Change or delete a spooled fileCHGSPLFA, DLTSPLFYesSecurity and owner rules matter
Hold or release an output queueHLDOUTQ, RLSOUTQYesAffects the queue, not just one file

Use the IBM i Spooled File and Output Queue Commands Reference when output is missing, stuck, private, on the wrong queue, or safe to delete.

Messages and logs

TaskStart withChanges something?Notes
See job messagesDSPJOBLOGNoRead earlier diagnostic messages before the escape message
Look up message textDSPMSGDNoName the message file when it is not QCPFMSG
Work with a message queueWRKMSG, DSPMSGUsually noReplying to inquiry messages changes processing
Reply to an inquiry messageRPGMMSG, display option repliesYesReply only when you know the consequence

The IBM i Job Log and CPF Messages Reference covers message IDs and job logs.

Subsystems, queues and scheduled work

TaskStart withChanges something?Notes
See subsystem statusWRKSBS, WRKACTJOB SBS(...)No, until you take an optionGood for operations triage
Start or end a subsystemSTRSBS, ENDSBSYesProduction-impacting
Submit a batch jobSBMJOBYesCreates a job on a job queue
Work with job queuesWRKJOBQYes, depending on optionHolding a queue stops new work from starting
Work with scheduled jobsWRKJOBSCDE, ADDJOBSCDEYesScheduling changes should be reviewed

For background, read IBM i System Operations with CL.

Security and authority

TaskStart withChanges something?Notes
Display object authorityDSPOBJAUTNoReview before changing authority
Grant or revoke object authorityGRTOBJAUT, RVKOBJAUTYesSecurity change
Change ownerCHGOBJOWNYesOwnership affects authority and responsibility
Work with user profilesWRKUSRPRF, DSPUSRPRFYes, depending on optionProtect special authorities

Security commands are not just lookup tools. Use site approvals, and read IBM i Security Fundamentals and Best Practices before broad changes.

Backup, recovery and maintenance

TaskStart withChanges something?Notes
Save objects or librariesSAVOBJ, SAVLIB, SAVCHGOBJYesWrites save media or save files
Restore objects or librariesRSTOBJ, RSTLIBYesCan overwrite or replace objects
Work with PTFsWRKPTFGRP, DSPPTF, LODPTF, APYPTFYes, for load/applyCoordinate with maintenance windows
Power downPWRDWNSYSYesSystem-wide impact

Common mistakes

  • Using a work-with display as if every option is read-only.
  • Running a command in the wrong job and assuming the library list changed globally.
  • Omitting the object type on object commands and finding the wrong thing.
  • Deleting or changing spooled files without checking owner and output queue authority.
  • Ending a job before reading the job log and message wait details.

Summary

  • Start with read-only inspection commands: WRKACTJOB, WRKJOB, DSPLIBL, WRKOBJ, DSPOBJD, WRKSPLF, DSPJOBLOG.
  • Treat ENDJOB, CHGLIBL, DLTSPLF, CHGSPLFA, HLDOUTQ, authority commands and save/restore commands as operational changes.
  • Use the family references for details: jobs, library lists, objects, spooled files and messages.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top