OUTPUT_QUEUE_ENTRIES table function

The OUTPUT_QUEUE_ENTRIES table function returns one row for each spooled file in an output queue.

Read syntax diagramSkip visual syntax diagramOUTPUT_QUEUE_ENTRIES( OUTQ_LIB =>  outq-lib, OUTQ_NAME =>  outq-name,DETAILED_INFO => detailed-info)
The schema is QSYS2.
To invoke this function, the caller must have:
  • Read authority to the output queue object, or
  • *JOBCTL special authority and the output queue has OPRCTL(*YES), or
  • *SPLCTL special authority
outq-lib
A character or graphic string expression that identifies the name of the library containing outq-name. If this parameter is blank, the default of *LIBL is used.
outq-name
A character or graphic string expression that identifies the name of an output queue.
detailed-info
A character or graphic string expression that indicates the type of information to be returned.
*YES
All the information available for the output queue is returned.
*NO
Only the general information is returned for the output queue. This is the information in the columns prior to the ACCOUNTING_CODE column. This is the default.

The result of the function is a table containing rows with the format shown in the following table. All the columns are nullable.

Table 1. OUTPUT_QUEUE_ENTRIES table function
Column Name Data Type Description
CREATE_TIMESTAMP TIMESTAMP The timestamp when the file was created.
SPOOLED_FILE_NAME 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 VARCHAR(10) The name of the user profile that produced the file.
USER_DATA VARCHAR(10) The user-specified data that describes this file. Contains null if there is no user-specified data.
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 INTEGER The size of the spooled file, in kilobytes.
TOTAL_PAGES INTEGER The total number of pages in the file.
COPIES SMALLINT The number of copies remaining to print.
FORM_TYPE VARCHAR(10) The type of form that should be loaded in the printer to print this file.
JOB_NAME VARCHAR(28) The qualified job name that produced the file.
DEVICE_TYPE 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 SMALLINT The priority of the spooled file.
FILE_NUMBER INTEGER The spooled file number of the specified file.
SYSTEM VARCHAR(8) The name of the system where the job that created the spooled file ran.
Values for the following columns are returned when the DETAILED_INFO parameter is *YES. Otherwise, the columns will contain the null value.
ACCOUNTING_CODE VARCHAR(15) An identifier assigned by the system to record the resources used to write this file.
EXPIRATION_DATE DATE 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 VARCHAR(4) Indicates whether this file is to be saved after it is written.
*NO
The file is deleted after it has been written.
*YES
The file is set to save status after it has been written.
PAGE_LENGTH INTEGER The page length, in lines per page, used by the spooled file.
LINES_PER_INCH DECIMAL(5,1) The number of lines per vertical inch defined in the printer file.
PAGE_WIDTH INTEGER The page width, in characters per printed line, used by the spooled file.
CHARACTERS_PER_INCH DECIMAL(5,1) The number of characters per horizontal inch, defined in the printer file.
PRINT_FIDELITY VARCHAR(8) The kind of error handling that is performed when printing.
*ABSOLUTE
The file is printed only if it can be printed exactly as specified in the data stream.
*CONTENT
The printing overrides errors in the data stream and continues printing with the printers best quality based on the content fidelity.
PAGE_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.
*AUTO
Computer output reduction is done automatically if the output is too large to fit on the form, regardless of the print quality.
*DEVD
The operating system sends a device default rotation value to the printer. Page rotation is dependent on the printer's specifications.
*COR
Output created for a form 13.2 inches wide by 11.0 inches long is adjusted to print on a form 11.0 inches wide by 8.5 inches long.
PRINT_BOTH_SIDES VARCHAR(7) How the information prints.
*FORMDF
The file uses a user-specified form definition. This value is used only for *LINE, *AFPDS, and *AFPDSLINE printer device type files.
*NO
The printing on the page is on one side only.
*YES
The printing is on both sides of the page with the top of each page the same for both sides.
*TUMBLE
The printing is on both sides with the top of one printed page at the opposite end from the top of the other printed page.
FILE_AVAILABLE VARCHAR(8) The time when this file becomes available to an output device for processing.
*IMMED
The file is available as soon as the file is opened.
*FILEEND
The file is available as soon as the file is closed.
*JOBEND
The file is available when the job that owns the file is completed.
STARTING_PAGE VARCHAR(10) The page at which printing is to start for the file. Can contain the following special value:
*ENDPAGE
Printing starts with the last page.
ENDING_PAGE VARCHAR(10) The page at which printing is to end for the file. Can contain the following special value:
*END
Printing ends with the last page.
DEVICE_FILE_LIBRARY VARCHAR(10) The name of the library that contains the device file.
DEVICE_FILE_NAME VARCHAR(10) The name of the device file used to create the spooled file.
PROGRAM_THAT_OPENED_FILE_LIBRARY VARCHAR(10) 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 VARCHAR(10) The name of the program that opened the spooled file. Contains null when the program is not known.
FORM_DEFINITION_LIBRARY VARCHAR(10) 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 VARCHAR(10) The name of the form definition to use for this print request. Can contain one of the following special values:
*DEVD
The form definition in the printer device description will be used.
*INLINE
The form definition defined in the spooled file data stream will be used.
*INLINED
The form definition defined in the spooled file data stream will be used. If a form definition is not found, the form definition in the printer device description will be used.
F1DFLT
The form definition defined in the spooled file data stream will be used.
Contains null when no form definition is specified for this spooled file.
PAGE_DEFINITION_LIBRARY VARCHAR(10) The name of the library containing the page definition. Contains the null value for *LINE or *AFPDSLINE printer device type files.
PAGE_DEFINITION_NAME VARCHAR(10) 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 VARCHAR(10) The name of the library containing the front overlay. Can contain one of these special values:
*CURLIB
The current ibrary is searched the front overlay.
*LIBL
The library list is used to locate the front overlay.
Contains null when FRONT_OVERLAY_NAME is *NONE.
FRONT_OVERLAY_NAME VARCHAR(10) The name of the front overlay. Can contain the following special value:
*NONE
The file does not use the front overlay.
BACK_OVERLAY_LIBRARY VARCHAR(10) The name of the library containing the back overlay. Contains null when BACK_OVERLAY_NAME is a special value.
BACK_OVERLAY_NAME VARCHAR(10) The name of the back overlay. Can contain the following special values:
*FRONTOVL
The back overlay is the same as the front overlay.
*NONE
The file does not use the back overlay.
CHARACTER_SET_LIBRARY VARCHAR(10) The name of the library containing the font character set object. Can contain one of these special values:
*CURLIB
The current library is searched for the font character set object.
*LIBL
The library list is used to locate the font character set object.
Contains null when CHARACTER_SET_NAME is *FONT.
CHARACTER_SET_NAME VARCHAR(10) The name of the font character set object used to print this file. Can contain the following special value:
*FONT
The information specified on the font parameter is used instead of the character set and code page.
CODE_PAGE_LIBRARY VARCHAR(10) The name of the library containing the code page used to print this spooled file. Can contain one of these special values:
*CURLIB
The current library is searched for the code page name.
*LIBL
The library list is used to locate the code page name.
Contains null when no code page is specified for this spooled file.
CODE_PAGE_NAME VARCHAR(10) 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 DECIMAL(5,1) The point size in which this file's characters should be printed. Contains null if the character set does not have a point size.
CODED_FONT_LIBRARY VARCHAR(10) The name of the library containing the coded font used to print this spooled file. Can contain one of these special values:
*CURLIB
The current library is searched for the coded font.
*LIBL
The library list is used to locate the coded font.
Contains null when CODED_FONT_NAME is *FNTCHRSET.
CODED_FONT_NAME VARCHAR(10) The name of the coded font used to print this spooled file. Can contain the following special value:
*FNTCHRSET
The values used are the values specified on the character set name and library name and code page name and library name fields.
CODED_FONT_POINTSIZE DECIMAL(5,1) The point size in which this file's characters should be printed. Contains null if the coded font does not have a point size.
MULTIBYTE_DATA 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 VARCHAR(10) The name of the library containing the DBCS-coded font. Can contain one of these special values:
*CURLIB
The current library is searched for the DBCS-coded font.
*LIBL
The library list is used to locate the DBCS-coded font.
Contains null when DBCS_CODED_FONT_NAME is *SYSVAL.
DBCS_CODED_FONT_NAME 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:
*SYSVAL
The DBCS-coded font specified in the system value is used.
DBCS_CODED_FONT_POINTSIZE DECIMAL(5,1) The point size in which this file's DCBS characters should be printed. Contains null if the DBCS-coded font does not have a point size.

Example

Find the 100 largest spool files in the QEZJOBLOG output queue. Since no detailed information is needed, specify *NO to avoid the additional processing.

SELECT * 
  FROM TABLE(QSYS2.OUTPUT_QUEUE_ENTRIES('*LIBL', 'QEZJOBLOG', '*NO')) A
  ORDER BY SIZE DESC
  FETCH FIRST 100 ROWS ONLY