OUTPUT_QUEUE_ENTRIES_BASIC view

The OUTPUT_QUEUE_ENTRIES_BASIC view returns one row for each spooled file in every output queue. This view uses the QSYS2.OUTPUT_QUEUE_ENTRIES table function with DETAILED_INFO => 'NO'.

Authorization: The caller must have:
  • *EXECUTE authority to the output queue library and
    • *READ authority to the output queue object, or
    • *SPLCTL special authority, or
    • *JOBCTL special authority and the output queue is defined with OPRCTL(*YES).

To achieve the best performance when querying the OUTPUT_QUEUE_ENTRIES_BASIC view, the use of a WHERE clause is recommended if you are interested in examining specific output queue libraries or output queues. OUTPUT_QUEUE_ENTRIES_BASIC typically performs much better than OUTPUT_QUEUE_ENTRIES. OUTPUT_QUEUE_ENTRIES should only be used when OUTPUT_QUEUE_ENTRIES_BASIC does not include the columns needed by the query.

The following table describes the columns in the view. The system name is OUTQ_INFOB. The schema is QSYS2.

Table 1. OUTPUT_QUEUE_ENTRIES_BASIC view
Column Name System Column Name Data Type Description
OUTPUT_QUEUE_NAME OUTQ VARCHAR(10) Name of the output queue containing the spooled file.
OUTPUT_QUEUE_LIBRARY_NAME OUTQLIB VARCHAR(10) The name of the library that contains the output queue.
CREATE_TIMESTAMP CREATED TIMESTAMP The timestamp when the file was created.
SPOOLED_FILE_NAME SPOOLNAME VARCHAR(10) The file name that was specified by the user program when the file was created, or the name of the device file used to create this file.
USER_NAME USER_NAME VARCHAR(10) The name of the user profile that produced the file.
USER_DATA USER_DATA VARCHAR(10)
Nullable
The user-specified data that describes this file. Contains null if there is no user-specified data.
STATUS STATUS VARCHAR(15) Status of the spooled file.
CLOSED
The file has been completely processed by a program but SCHEDULE(*JOBEND) was specified and the job that produced the file has not yet finished.
DEFERRED
Printing of the file has been deferred.
DELETED
The file has been deleted.
HELD
The file has been held.
MESSAGE WAITING
This file has a message which needs a reply or an action to be taken.
OPEN
The file has not been completely processed and is not ready to be selected by a writer.
PENDING
The file is pending to be printed.
PRINTING
The file has been completely sent to the printer but print complete status has not been sent back.
READY
The file is available to be written.
SAVED
The file has been printed and then saved. This file remains saved until it is released.
SENDING
The file is being sent or has been sent to a remote system.
WRITING
This file is currently being produced by the writer.
SIZE SIZE INTEGER The size of the spooled file, in kilobytes.
TOTAL_PAGES PAGES INTEGER The total number of pages in the file.
COPIES COPIES SMALLINT The number of copies remaining to print.
FORM_TYPE FORM_TYPE VARCHAR(10) The type of form that should be loaded in the printer to print this file.
JOB_NAME JOB_NAME VARCHAR(28) The qualified job name that produced the file.
DEVICE_TYPE DEVTYPE VARCHAR(10) The type of data stream used to represent the file.
*AFPDS
Advanced Function Presentation data stream
*AFPDSLINE
AFPDS data mixed with 1403 line data
*IPDS
Intelligent printer data stream
*LINE
1403 line data
*SCS
Systems Network Architecture (SNA) character stream
*USERASCII
ASCII data
OUTPUT_PRIORITY OUTPTY SMALLINT The priority of the spooled file.
FILE_NUMBER FILENUM INTEGER The spooled file number of the specified file.
SYSTEM SYSTEM VARCHAR(8) The name of the system where the job that created the spooled file ran.

Examples

  • Find the 100 largest spool files in the QEZJOBLOG output queue.
    SELECT * FROM QSYS2.OUTPUT_QUEUE_ENTRIES_BASIC
      WHERE OUTPUT_QUEUE_NAME = 'QEZJOBLOG'
      ORDER BY SIZE DESC
      FETCH FIRST 100 ROWS ONLY
  • Find the top 10 consumers of SPOOL storage.
    SELECT USER_NAME, SUM(SIZE) AS TOTAL_SPOOL_SPACE
      FROM QSYS2.OUTPUT_QUEUE_ENTRIES_BASIC
      WHERE USER_NAME NOT LIKE 'Q%'
      GROUP BY USER_NAME
      ORDER BY TOTAL_SPOOL_SPACE DESC LIMIT 10;