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 library containing the output queue, 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.
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.
|
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.
|
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;