SPOOLED_FILE_INFO table function
The SPOOLED_FILE_INFO table function returns a list of spooled files on the system.
This information is similar to what is returned by the Work with Spooled Files (WRKSPLF) CL command and the Open List of Spooled Files (QGYOLSPL) API.
- *EXECUTE authority to the library containing the output queue, and
- *USE authority to the output queue containing the spooled file.
The schema is QSYS2.
Filtering on multiple values of user-name, output-queue, or user-data is slower.
Additionally, filtering on status is slower.
- user-name
- A character string containing user profile names to filter on. The list can contain up to 20 values separated by blanks.
- starting-timestamp
- A timestamp value for the earliest spooled file to return. If the parameter is omitted or the null value, all spooled files with a create timestamp less than or equal to ending-timestamp are returned.
- ending-timestamp
- A timestamp value for the latest spooled file to return. If the parameter is omitted or the null value, all spooled files with a create timestamp greater than or equal to starting-timestamp are returned.
- status
- A character string containing the spooled file status to filter on. The list can contain one or more status values separated by blanks.
- job-name
- A character string containing qualified job name.
- output-queue
- A character string containing the name of the output queue to filter on. An output queue name must be in the format library-name/outq-name. The list can contain up to 20 values separated by blanks.
- user-data
- A character string containing the value of the user-specified data or file name for spooled files to filter on.
- form-type
- A character string containing the form type value to filter on.
- system-name
- A character string containing the name of the system where the job that created the spooled file ran.
The result of the function is a table containing rows with the format shown in the following table. All columns are nullable.
Column Name | Data Type | Description |
---|---|---|
SPOOLED_FILE_NAME | VARCHAR(10) | The name of the spooled file. |
SPOOLED_FILE_NUMBER | INTEGER | The number of the spooled file. |
STATUS | VARCHAR(15) | The status of the file.
|
OUTPUT_PRIORITY | INTEGER | The priority of the spooled file. The priority
ranges from 1 (highest) to 9 (lowest). Contains the null value when STATUS is DELETED. |
CREATION_TIMESTAMP | TIMESTAMP(0) | The timestamp, based on local job time, when the file was opened. |
USER_DATA | VARCHAR(10) | The user-specified data that describes the
file. Contains the null value if there is no user-specified data or STATUS is DELETED. |
SIZE | BIGINT | The spooled file size in bytes. The size of the
spooled file is the data stream size plus the spooled file's attributes, plus the "overhead" storage
used to store the spooled file's data stream. Contains the null value if the size is not available or STATUS is DELETED. |
TOTAL_PAGES | INTEGER | The total number of pages or number of records for
the spooled file. Contains the null value if the total number of pages is not available or STATUS is DELETED. |
COPIES | INTEGER | The number of copies remaining to print. Contains the null value when STATUS is DELETED. |
QUALIFIED_JOB_NAME | VARCHAR(28) | The qualified job name of the job that owns the spooled file. |
JOB_NAME | VARCHAR(10) | The name of the job that owns the spooled file. |
JOB_USER | VARCHAR(10) | The name of the user that owns the spooled file. |
JOB_NUMBER | VARCHAR(6) | The number of the job that owns the spooled file. |
FILE_AVAILABLE | VARCHAR(8) | The schedule of the spooled file.
|
FORM_TYPE | VARCHAR(10) | Spooled file form type. The type of form to load in
the printer to print this file. Contains the null value when STATUS is DELETED. |
OUTPUT_QUEUE_LIBRARY | VARCHAR(10) | The library where the output queue is
located. Contains the null value when STATUS is DELETED. |
OUTPUT_QUEUE | VARCHAR(10) | The name of the output queue in which the spooled
file is located. Contains the null value when STATUS is DELETED. |
ASP_NUMBER | INTEGER | The auxiliary storage pool in which the spooled file
resides. Contains the null value when STATUS is DELETED. |
SYSTEM | VARCHAR(8) | The name of the system where the job that created the spooled file ran. |
INTERNET_PRINT_PROTOCOL_JOB_ID | INTEGER | The IPP job identifier assigned by the system based
on the output queue to which the file was added or moved. This value ranges from 1 to 2147483647 and
is not guaranteed to be unique for a given output queue. Contains the null value when STATUS is DELETED. |
Example
- List all the spooled files for the current
job.
SELECT * FROM TABLE(QSYS2.SPOOLED_FILE_INFO(JOB_NAME => '*'));