OUTPUT_QUEUE_ENTRIES view
The OUTPUT_QUEUE_ENTRIES 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 => 'YES'.
- *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 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_INFO. 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. |
ACCOUNTING_CODE | ACGCDE | VARCHAR(15) | An identifier assigned by the system to record the resources used to write this file. |
EXPIRATION_DATE | EXPDATE | DATE Nullable
|
The date the file will be eligible for removal from the system by the Delete Expired Spooled Files (DLTEXPSPLF) command. Contains the null value if the file will not expire. |
SAVE_AFTER_WRITE | SAVEAFTER | VARCHAR(4) | Indicates whether this file is to be saved after it is written.
|
TOTAL_RECORDS | TOTALRCDS | INTEGER | The total number of records in the printer file. It is possible
for TOTAL_RECORDS to be larger than MAXIMUM_RECORDS due to a reply to inquiry message
CPA4072. Contains null if the spooled file data stream is not *AFPDS, *AFPDSLINE, or *LINE, or if the file is open. |
MAXIMUM_RECORDS | MAXRCDS | INTEGER | The maximum number of records allowed in the file at the time the
file was opened. Contains null if there is no maximum. |
PAGE_LENGTH | PAGELEN | INTEGER | The page length, in lines per page, used by the spooled file. |
LINES_PER_INCH | LPI | DECIMAL(5,1) | The number of lines per vertical inch defined in the printer file. |
PAGE_WIDTH | WIDTH | INTEGER | The page width, in characters per printed line, used by the spooled file. |
CHARACTERS_PER_INCH | CPI | DECIMAL(5,1) | The number of characters per horizontal inch, defined in the printer file. |
PRINT_FIDELITY | FIDELITY | VARCHAR(8) | The kind of error handling that is performed when printing.
|
PAGE_ROTATION | ROTATION | VARCHAR(5) | The degree of rotation of the text on the page, with respect to
the way the form is loaded into the printer.
|
PRINT_BOTH_SIDES | BOTHSIDES | VARCHAR(7) | How the information prints.
|
FILE_AVAILABLE | FILEAVAIL | VARCHAR(8) | The time when this file becomes available to an output device for processing.
|
STARTING_PAGE | STARTPAGE | VARCHAR(10) | The page at which printing is to start for the file. Can contain
the following special value:
|
ENDING_PAGE | ENDPAGE | VARCHAR(10) | The page at which printing is to end for the file. Can contain
the following special value:
|
DEVICE_FILE_LIBRARY | DEVLIB | VARCHAR(10) | The name of the library that contains the device file. |
DEVICE_FILE_NAME | DEVFILE | VARCHAR(10) | The name of the device file used to create the spooled file. |
USER_DEFINED_DATA | USRDFNDTA | BINARY(255) | Data defined by the user to be used by user applications or
user-specified programs that process spooled files. Contains null when there is no user-defined data. |
PROGRAM_THAT_OPENED_
FILE_LIBRARY |
LIBOPEN | VARCHAR(10) Nullable
|
The name of the library that contains the program that opened the file. Contains null when the program is not known. |
PROGRAM_THAT_OPENED_
FILE_NAME |
PGMOPEN | VARCHAR(10) Nullable
|
The name of the program that opened the spooled file. Contains null when the program is not known. |
FORM_DEFINITION_LIBRARY | FORMLIB | VARCHAR(10) Nullable
|
The name of the library that contains the form definition. Contains null if FORM_DEFINITION_NAME is a special value or if no form definition is specified for this spooled file. |
FORM_DEFINITION_NAME | FORMNAME | VARCHAR(10) Nullable
|
The name of the form definition to use for this print request.
Can contain one of the following special values:
|
PAGE_DEFINITION_LIBRARY | PAGELIB | VARCHAR(10) Nullable
|
The name of the library containing the page definition. Contains the null value for *LINE or *AFPDSLINE printer device type files. |
PAGE_DEFINITION_NAME | PAGENAME | VARCHAR(10) Nullable
|
The name of the page definition to use for the file. Contains the null value for *LINE or *AFPDSLINE printer device type files. |
FRONT_OVERLAY_LIBRARY | FRONTLIB | VARCHAR(10) Nullable
|
The name of the library containing the front overlay. Can contain
one of these special values:
|
FRONT_OVERLAY_NAME | FRONTNAME | VARCHAR(10) | The name of the front overlay. Can contain the following special value:
|
BACK_OVERLAY_LIBRARY | BACKLIB | VARCHAR(10) Nullable
|
The name of the library containing the back overlay. Contains null when BACK_OVERLAY_NAME is a special value. |
BACK_OVERLAY_NAME | BACKNAME | VARCHAR(10) | The name of the back overlay. Can contain the following special values:
|
CHARACTER_SET_LIBRARY | CHRSETLIB | VARCHAR(10) Nullable
|
The name of the library containing the font character set object.
Can contain one of these special values:
|
CHARACTER_SET_NAME | CHRSETNAME | VARCHAR(10) | The name of the font character set object used to print this
file. Can contain the following special value:
|
CODE_PAGE_LIBRARY | CODELIB | VARCHAR(10) Nullable
|
The name of the library containing the code page used to print
this spooled file. Can contain one of these special values:
|
CODE_PAGE_NAME | CODENAME | VARCHAR(10) Nullable
|
The name of the code page used to print this spooled file. Contains null when no code page is specified for this spooled file. |
CHARACTER_SET_POINTSIZE | CHARSIZE | DECIMAL(5,1) Nullable
|
The point size in which this file's characters (defined by CHARACTER_SET) should be printed. Contains null if the character set does not have a point size. |
CODED_FONT_LIBRARY | FONTLIB | VARCHAR(10) Nullable
|
The name of the library containing the coded font used to print
this spooled file. Can contain one of these special values:
|
CODED_FONT_NAME | FONTNAME | VARCHAR(10) | The name of the coded font used to print this spooled file. Can
contain the following special value:
|
CODED_FONT_POINTSIZE | FONTSIZE | DECIMAL(5,1) Nullable
|
The point size in which this file's characters (defined by CODED_FONT) should be printed. Contains null if the coded font does not have a point size. |
MULTIBYTE_DATA | MULTIBYTE | VARCHAR(10) | Whether the file can contain double-byte character set (DBCS) data, Unicode data, or both. Values are *YES and *NO. |
DBCS_CODED_FONT_LIBRARY | DBCSLIB | VARCHAR(10) Nullable
|
The name of the library containing the DBCS-coded font. Can
contain one of these special values:
|
DBCS_CODED_FONT_NAME | DBCSNAME | VARCHAR(10) | The name of the DBCS-coded font used to print DBCS-coded data on
printers configured as AFP(*YES). Can contain the following special value:
|
DBCS_CODED_FONT_POINTSIZE | DBCSSIZE | DECIMAL(5,1) Nullable
|
The point size in which this file's DCBS characters (defined by DBCS_CODED_FONT) should be printed. Contains null if the DBCS-coded font does not have a point size. |
Example
WITH MOSTFILES(OUTQ_LIB, OUTQ_NAME) AS (
SELECT OUTPUT_QUEUE_LIBRARY_NAME, OUTPUT_QUEUE_NAME
FROM QSYS2.OUTPUT_QUEUE_INFO
ORDER BY NUMBER_OF_FILES DESC
LIMIT 1
)
SELECT SUM(SIZE) AS KB_TO_CLEAR
FROM MOSTFILES, QSYS2.OUTPUT_QUEUE_ENTRIES
WHERE OUTPUT_QUEUE_LIBRARY_NAME = OUTQ_LIB AND
OUTPUT_QUEUE_NAME = OUTQ_NAME AND
EXPIRATION_DATE IS NOT NULL AND
EXPIRATION_DATE < CURRENT DATE;