IBM i Spooled File and Output Queue Commands Reference

Spooled files are IBM i printer output waiting on output queues. Reports, job logs, invoices and labels can all sit there before a writer prints or sends them.

This page is a command lookup for finding, displaying, holding, releasing, moving and deleting spooled files. For the concept-level explanation, read IBM i Output Queues and Spool Files Explained.

Quick command map

TaskCommandChanges something?
List spooled filesWRKSPLFDisplay is read-only; options can change files
Work an output queueWRKOUTQDisplay is read-only; options can change files or queue
Display a spooled fileDSPSPLFNo
Change spooled-file attributesCHGSPLFAYes
Hold or release a spooled fileHLDSPLF, RLSSPLFYes
Delete a spooled fileDLTSPLFYes
Hold or release an output queueHLDOUTQ, RLSOUTQYes
Start or end a writerSTRPRTWTR, ENDWTRYes

WRKSPLF

WRKSPLF lists spooled files. Start here when a user says “my report did not print.”

WRKSPLF
WRKSPLF SELECT(USER1)
WRKSPLF SELECT(*CURRENT *ALL *ALL)

Filter by user, job, file name, output queue or form type when the list is large. The list is inspection until you take an option such as display, hold, release, change or delete.

WRKOUTQ

WRKOUTQ works with files on one output queue.

WRKOUTQ OUTQ(QPRINT)
WRKOUTQ OUTQ(MYLIB/INVOICES)

Use it when the question is queue-centered: many files are waiting, a writer is stopped, or output is held on a particular queue.

DSPSPLF

DSPSPLF displays the contents of a spooled file.

DSPSPLF FILE(QPJOBLOG) JOB(123456/USER/JOBNAME)

Use it to inspect a job log or report without printing. Security settings on the output queue can restrict who may display spooled-file data.

CHGSPLFA

CHGSPLFA changes spooled-file attributes such as output queue, number of copies, hold status or save attribute.

CHGSPLFA FILE(INVOICE) JOB(123456/USER/JOBNAME) OUTQ(PRTLIB/PRT01)
CHGSPLFA FILE(INVOICE) JOB(123456/USER/JOBNAME) COPIES(2)

Changing a spooled file affects real output. Confirm the file, job and queue before changing attributes.

The file-specific examples omit SPLNBR and therefore rely on its *ONLY default: exactly one spooled file with that name must exist in the selected job. If the job has duplicates, add SPLNBR(n) using the actual file number from WRKSPLF. Do this for display, change, hold, release and delete commands; never guess a number or use the latest file as a substitute for identifying the intended output.

HLDSPLF and RLSSPLF

Hold a spooled file when it should not print yet. Release it when it is ready.

HLDSPLF FILE(INVOICE) JOB(123456/USER/JOBNAME)
RLSSPLF FILE(INVOICE) JOB(123456/USER/JOBNAME)

Holding one spooled file is narrower than holding the entire output queue.

DLTSPLF

DLTSPLF deletes a spooled file.

DLTSPLF FILE(TESTRPT) JOB(123456/USER/JOBNAME)

Delete only when the output is no longer needed. Job logs and reports can be operational evidence.

HLDOUTQ and RLSOUTQ

These commands affect the queue.

HLDOUTQ OUTQ(MYLIB/INVOICES)
RLSOUTQ OUTQ(MYLIB/INVOICES)

Use them for queue-level control, such as stopping all files from printing while a printer problem is investigated. They affect more than one user’s output.

Troubleshooting patterns

SymptomCheck
Report not printedWRKSPLF for the user and WRKOUTQ for the queue
Job ended but no log visibleLook for QPJOBLOG in the job’s spooled files
File is on wrong printerCHGSPLFA OUTQ(...) after confirming destination
File is waitingCheck hold status, output queue status and writer status
User cannot see outputOutput queue security, owner, DSPDTA and authority
Too many old filesReview retention policy before deleting

IBM’s security documentation ties output-queue parameters, queue authority and special authority together. Be careful with broad spool-control authority. Spooled files can contain confidential data.

Common mistakes

  • Deleting a job log before the failure is understood.
  • Holding an entire output queue when one spooled file should be held.
  • Changing output queue or copies on the wrong duplicate file.
  • Assuming every operator can display confidential spooled-file data.
  • Forgetting that WRKSPLF and WRKOUTQ options can change or delete output.
  • Releasing output before checking forms, printer and queue destination.

Output queue versus spooled file

Choose the narrowest action that solves the problem.

NeedPrefer
Stop one report from printingHLDSPLF
Let one held report printRLSSPLF
Move one report to another queueCHGSPLFA OUTQ(...)
Stop everything on a queueHLDOUTQ
Resume a queue after maintenanceRLSOUTQ
Remove one unneeded output itemDLTSPLF

Queue-level commands can affect many users. File-level commands are safer when the problem is one report, one job log or one test print.

Security notes

Output is data. A spooled file may contain payroll, invoices, customer addresses or job diagnostic details. Before changing access, check who owns the output, which output queue holds it, and whether the queue permits display of spooled-file data.

For operations context, see IBM i System Operations with CL. For job-log output specifically, use the IBM i Job Log and CPF Messages Reference.

FAQ

Why can I see a spooled file but not display it?

The output queue security settings can allow listing while restricting display of the actual data. Owner and special authority rules can also apply.

Should I hold the queue or the file?

Hold the file when only one output item is the problem. Hold the queue when the printer, writer, forms or destination affects all files waiting there.

Is DLTSPLF safe for old job logs?

Only after retention and incident needs are satisfied. A job log can be the only evidence of why a batch process failed.

Before changing or deleting output

Use a quick evidence check before any mutating command.

CheckReason
File name and numberA job can create multiple spooled files with the same name
Job name, user and numberPrevents action against another user’s output
Output queueConfirms the current destination
User data and form typeHelps identify the business report
Creation date and timeSeparates the latest run from an older run
Save attributeDetermines whether output remains after printing

If the output belongs to a failed job, inspect the job log before deleting it. If it is customer-facing output, confirm whether the business process has already reprinted or resent it.

Writer checks

When a queue has ready output but nothing prints, check the writer and device before changing every file. A held writer, varied-off device, forms mismatch or message wait can stop output even when the spooled files themselves are ready. Queue-level commands are useful after you know the problem is queue-wide.

Summary

  • Use WRKSPLF for a user’s or job’s output and WRKOUTQ for queue-centered work.
  • Use DSPSPLF to inspect output without printing.
  • Treat CHGSPLFA, HLDSPLF, RLSSPLF, DLTSPLF, HLDOUTQ and RLSOUTQ as operational changes.
  • Preserve job logs and business reports until the incident or retention need is resolved.

Leave a Comment

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

Scroll to Top