Order of spooled files on an output queue

The order of spooled files on an output queue is mainly determined by the status of the spooled file.

A spooled file that is being processed by a writer might have a status of printing (PRT status), writer (WTR status), pending to be printed (PND status), or being sent (SND status). Spooled files with a status of PRT, WTR, PND, or SND are placed at the top of the output queue. A spooled file being processed by the writer might have a held (HLD) status if a user has held the spooled file but the writer is not yet finished processing the file. All other spooled files with a status of RDY are listed on the output queue after the file being processed by a writer, followed by deferred spooled files (DFR status), and then followed by spooled files with a status other than RDY or DFR.

Each group of spooled files (RDY and non-RDY files) is further sorted by:

  1. The output priority of the spooled file.
  2. A date and time field (time stamp).
  3. The SCHEDULE parameter value of the spooled file. Files with SCHEDULE(*JOBEND) specified are grouped together and placed after other spooled files of the same job that have SCHEDULE(*IMMED) or SCHEDULE(*FILEEND) specified.
  4. The spool number of the spooled file.

For output queues with SEQ(*JOBNBR) specified, the date and time field is the date and time that the job that created the spooled file entered the system. (A sequential job number and time of day value are also assigned to the job when it enters the system.) That is how the spooled files are sorted on the queue.

For first-in-first-out (*FIFO) output queues, the date and time change to the current system date and time when:

Because of the automatic sorting of spooled files, different results occur when SEQ(*JOBNBR) is specified for an output queue than when SEQ(*FIFO) is specified. For example, when a spooled file is held and then immediately released on an output queue with SEQ(*JOBNBR) specified, the spooled file will end up where it started. However, if the same spooled file were held and then immediately released on an output queue with SEQ(*FIFO) specified, the spooled file would be placed at the end of the spooled files that have the same priority and a status of RDY.