Open List of Spooled Files (QGYOLSPL) API


  Required Parameter Group:


  Optional Parameter Group:


  Default Public Authority: *USE

  Threadsafe: No

The Open List of Spooled Files (QGYOLSPL) API generates a list of spooled files on the system. It creates a list similar to the list created by calling the List Spooled Files (QUSLSPL) API. The list can include all spooled files or those of specific users, output queues, form types, user-specified data values, statuses, printers, or specific jobs. The filtered list can then be sorted depending on the value of the sort parameter. You can specify how many list entries to return when calling this API. At a later time, you can request additional entries from the list using the Get List Entries (QGYGTLE) API. You can close this list by using the Close List (QGYCLST) API.

Note: The QTEMP library and the system portion of the library list could be different between the main job and the server job when the list is being built asynchronously. If this is a problem, request that the list be built synchronously.

For more information, see Process Open List APIs.


Differences between QUSLSPL and QGYOLSPL


Performance Impacts

Filtering on multiple values of user name, qualified output queue name, or user-specified data takes more processing power and time.

Additionally, filtering on a status or a printer device name takes more processing power and time.


Authorities and Locks

Output Queue Authority
*USE
Output Queue Library Authority
*EXECUTE

Required Parameter Group

Receiver variable
OUTPUT; CHAR(*)

The variable used to return the number of records requested (given in the number of records to return parameter) of spooled file information. See Format of Receiver Variable for a description of the layout of this parameter.

Length of receiver variable
INPUT; BINARY(4)

The length of the receiver variable.

List information
OUTPUT; CHAR(80)

Information about the list created by this program. For a description of the layout of this parameter, see Open list information format.

Number of records to return
INPUT; BINARY(4)

The number of records in the list to put into the receiver variable after filtering and sorting has been done.

If -1 is specified for this parameter the entire list is built synchronously.

If 0 is specified for this parameter the entire list is built asynchronously in a server job.

If a positive number of records to return is specified, at least that many records will be built synchronously and the remainder will be built asynchronously in a server job.

Sort information
INPUT; CHAR(*)

Information about what fields within the record of information to sort. See Format of Sort Information for a description of the layout of this parameter. Note that when sorting is requested, the entire list has to be built and sorted before any records can be returned.

Filter information
INPUT; CHAR(*)

The information in this parameter is used for filtering the list of spooled file information. For more details about filtering options, see Format of Filter Information.

Qualified job name
INPUT; CHAR(26)

The qualified job name of the job whose files are to be included in the list. This parameter can be blank. If blanks are specified, spooled files will be listed for all jobs that match the criteria specified in the filter information parameter.

The qualified job name has three parts:


Format of the generated list
INPUT; CHAR(8)

The format of the spooled file information being returned.

You must specify one of the following:


The OSPL0100 format returns information faster than the OSPL0200 format.

The OSPL0300 and OSPL0400 formats return information faster than the OSPL0100 format.

Error code
I/O; CHAR(*)

The structure in which to return error information. For the format of the structure, see Error code parameter.


Optional Parameter Group

Format of filter information
INPUT; CHAR(8)

The format of the filter information passed in the Filter information parameter.


Format of Receiver Variable

The following tables describe the order and format of the data returned in the receiver variable.


OSPL0100 Format

For more details about the fields in the following table, see Field Descriptions.



Format OSPL0100 extension

For more details about the fields in the following table, see Field Descriptions.



Format OSPL0200

For more details about the fields in the following table, see Field Descriptions.



Format OSPL0300

For more details about the fields in the following table, see Field Descriptions.



Format OSPL0400

For more details about the fields in the following table, see Field Descriptions.



Format of Filter Information

Filter Information Format OSPF0100

For more details about the fields in the following table, see Field Descriptions.



Filter Information Format OSPF0200

For more details about the fields in the following table, see Field Descriptions.



User Name Entry

For more details about the fields in the following table, see Field Descriptions.



Output Queue Name Entry

For more details about the fields in the following table, see Field Descriptions.



Spooled File Status Entry

For more details about the fields in the following table, see Field Descriptions.



Printer Device Name Entry

For more details about the fields in the following table, see Field Descriptions.



Format of Sort Information

For more details about the fields in the following table, see Field Descriptions.

Note: If the last 3 fields (sort key field data type, sort order, and the reserved field) are not used, then they must be set to hexadecimal zeros. This causes all the data to be treated as character data, and it is sorted in ascending order.


Field Descriptions

Auxiliary storage pool. The auxiliary storage pool in which the spooled file resides.

Valid values are:

Copies left to print. The remaining number of copies to be printed. This attribute applies to printer device type spooled files only.

Current page. The page number or record number currently being written. The page number may be lower or higher than the page number actually being printed because of buffering done by the system. For example, if the spooled file is routed to a diskette unit or the writer is currently printing job separators or file separators for the spooled file, the page number shown may be zero.

Date spooled file was created in UTC. The date, based on Coordinated Universal Time (UTC), that the file was opened in the CYYMMDD format.

Date spooled file was opened (created). The date, based on local job time, that the file was opened in the CYYMMDD format.

Device type. The type of device for which the spooled file is intended. The possible values are PRINTER or DISKETTE.

Ending spooled file create date. The date, based on local job time, that the spooled file was created on the system. If the Starting spooled file create date field is set to *ALL, then this field must be set to blanks. If a date has been specified for the Starting spooled file create date field, then this field must be set to a valid date. The date must be in the CYYMMDD format or one of the following special values:

The date format CYYMMDD is defined as follows:

Ending spooled file create time. The time, in local job time, that the spooled file was created on the system. This field must be set to blanks when special value *ALL is used for field Starting spooled file create date or when special value *LAST is used for field Ending spooled file create date. This field must have a value set if a date is specified for field Ending spooled file create date. The time must be in the HHMMSS format.

The time format HHMMSS is defined as follows:

File status. The status of the file. The following list of values is used to describe the status of the file:

Form type. The type of forms that should be loaded on the printer before this spooled file is printed or spooled files whose form type matches this value are included in the list. This attribute applies to printer device type spooled files only. This field can be used in conjunction with the user, output queue and library, user-specified data, status, device fields and qualified job name parameter to subset the list of all the spooled files.

The following special values can be used for the form type:

Internal job identifier. The internal identifier for the job. Only the IBM® i APIs use this identifier, not any other interface on the system. The identifier is not valid following an initial program load (IPL). If you attempt to use it after an IPL, an exception occurs. This identifier is always valid when used with the internal spooled file identifier as input to IBM i APIs. For spooled files which have been detached from their jobs or which are on independent disk pools, this value is not valid as input to some IBM i APIs, such as the Retrieve Job Information (QUSRJOBI) API, that take this value without the internal spooled file identifier.

Internal spooled file identifier. The input value that other programs use to improve the performance of locating the spooled file on the system. Only the spooled file APIs use this identifier, not any other interface on the system. The identifier is not valid following an initial program load (IPL) or if the spooled file has been moved between auxiliary storage pools (ASPs). If you attempt to use an invalid internal spooled file identifier, an exception occurs.

Internet print protocol job identifier. 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.

Job name. The name of the job that owns the spooled file.

Job number. The number of the job that owns the spooled file.

Job system name. The name of the system where the job that created the spooled file ran.

Length of filter information. The number of bytes of the fixed portion for the filter information provided. If this value is greater than 106, the extra bytes must be set to hexidecimal zeros.

Length of OSPL0100 extension. The size, in bytes, of the OSPL0100 format extension.

Length of output queue name entry. The size, in bytes, of the output queue name entry. The minimum allowed size is 20. The value of this field will be used by the API to find the next output queue name entry.

Length of printer device name entry. The size, in bytes, of the printer device name entry. The minimum allowed size is 10. The value of this field will be used by the API to find the next printer device name entry.

Length of spooled file status entry. The size, in bytes, of the spooled file status entry. The minimum allowed size is 10. The value of this field will be used by the API to find the next spooled file status entry.

Length of user name entry. The size, in bytes, of the user name entry. The minimum allowed size is 10. The value of this field will be used by the API to find the next user name entry.

Number of printer device names. The number of printer device names to filter on. The value specified must be greater than or equal to 1 for filter format OSPF0100. The value specified must be greater than or equal to 0 for filter format OSPF0200. With filter format OSPF0200, a value of 0 (*ALL) indicates spooled files are included in the list regardless of the printer device name.

Spooled files whose assigned printer device matches one of the printer device names specified are included in the list.

Number of keys to sort on. The number of fields within the record structure to sort on. If 0 is specified, the list is not sorted.

Number of output queue name entries. The number of output queues to filter on. The value specified must be greater than or equal to 1.

Spooled files whose output queue matches one of the output queues specified are included in the list.

Number of output queue names. The number of output queues to filter on. The value specified must be greater than or equal to 0. A value of 0 indicates spooled files are included in the list regardless of the output queue the spooled file resides on.

Spooled files whose output queue matches one of the output queues specified are included in the list.

Number of spooled file status entries. The number of spooled file statuses to filter on. The value specified must be greater than or equal to 0. A value of 0 indicates spooled files are included in the list regardless of the status of the spooled file.

Spooled files whose current status matches one of the statuses specified are included in the list.

Number of statuses. The number of spooled file statuses to filter on. The value specified must be greater than or equal to 1.

Spooled files whose current status matches one of the statuses specified are included in the list.

Number of user name entries. The number of user names to filter on. The value specified must be greater than or equal to 0. A value of 0 indicates spooled files are included in the list regardless of the user name.

Spooled files owned by one of the user profile names specified are included in the list.

Number of user names. The number of user names to filter on. The value specified must be greater than or equal to 1.

Spooled files owned by one of the user profile names specified are included in the list.

Offset to OSPL0100 extension. The offset, in bytes, from the beginning of the structure, to the OSPL0100 format extension.

Offset to output queue name entries. The offset, in bytes, from the beginning of the structure, to one or more output queue name entries.

Offset to printer device name entries. The offset, in bytes, from the beginning of the structure, to one or more printer device name entries.

Offset to spooled file status entries. The offset, in bytes, from the beginning of the structure, to one or more spooled file status entries.

Offset to user name entries. The offset, in bytes, from the beginning of the structure, to one or more user name entries.

Output queue library name. The name of the library where the output queue resides.

The following special values can be used for the output queue library name when filtering:

Output queue library name. The library where the output queue is located.

Output queue name. The name of the output queue to filter on or the name of the output queue in which the spooled file is located. At least one output queue or special value must be specified. This field can be used in conjunction with the user, form type, user-specified data, status, device fields and qualified job name parameter to subset the list of all the spooled files.

The following special value is used for the output queue name when filtering:


Printer assigned. Set to 1 when the spooled file is assigned to a specific printer. In this case, the printer name field contains the name of the assigned printer. Set to 2 when the spooled file is assigned to multiple printers. In this case, the printer name is set to blanks. Set to 3 when the spooled file is not assigned to a printer. In this case, the printer name is set to blanks. This attribute applies to printer device type spooled files only.

Printer device name. The name of the printer device to filter on. At least one printer device name or special value must be specified. This field can be used in conjunction with the user, output queue and library, form type, user-specified data, status fields and the qualified job name parameter to subset the list of all the spooled files. This field is not valid for format OSPL0100 and will be ignored for format OSPL0300 unless the only filtering requested is for a single printer device name. Note: For filtering information format OSPF0100, the first 10 characters contain the printer device, and the next 2 characters are reserved.

The following special value can be used for the device name:

Printer name. The name of the printer the spooled file has been assigned to print on. This attribute applies to printer device type spooled files only.

Priority. The priority of the spooled file. The priority ranges from 1 (highest) to 9 (lowest).

Reserved. Reserved field. Must be set to hexadecimal or binary zero.

Size of spooled file. The spooled file size. Multiply this field by the spooled file size multiplier field to get the size of the spooled file in number of 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.

Sort key field data type. Data type of field to sort. Refer to QLGSORT API for information about the list of data types available.

Sort key field length. The length of the field to sort on.

Sort key field starting position. Within the record of information, the starting position of the field to sort on.

Sort order. Used to specify if the list should be sorted in ascending or descending order according to the key.

Spooled file form type. The type of form to load in the printer to print this file.

Spooled file name. The name of the spooled file in the list entry.

Spooled file number. The number of the spooled file in the list entry.

Spooled file schedule. The schedule of the spooled file. Valid values are:

Spooled file size multiplier. The number to multiply the size of spooled file field to get the size of the spooled file in number of bytes.

Spooled file status. The spooled file status to filter on.

Refer to the QUSLSPL API for possible values for the spooled file status. At least one status or special value must be specified. This field can be used in conjunction with the user, output queue and library, form type, user-specified data, device fields and the qualified job name parameter to subset the list of all the spooled files.

Note: When using filter format OSPF0100, the first 10 characters contain the status, and the next 2 characters are reserved.

The following special values can be used for the spooled file status:

Starting spooled file create date. The date, based on local job time, that the spooled file was created on the system. The date must be in the CYYMMDD format or one of the following special values:

Starting spooled file create time. The time, in local job time, that the spooled file was created on the system. This field must be set to blanks when special value *ALL or *FIRST is used for field Starting spooled file create date. This field must have a value set if a date is specified for field Starting spooled file create date. The time must be in the HHMMSS format.

The time format HHMMSS is defined as follows:

System name. The name of the system where the job that created the spooled file ran. The following special values are supported for this field:

Time spooled file was created in UTC. The time, in Coordinated Universal Time (UTC), that the file was opened in the HHMMSS format.


Time spooled file was opened (created). The time, in local job time, that the file was opened in the HHMMSS format.


Total pages. The total number of pages or number of records for a particular spooled file.

User data. The 10 characters of user-specified data that describe the file.

User name. The name of the user that owns the spooled file or the name of the user to filter on. At least one user name or special value must be specified. This field can be used in conjunction with the output queue and library, form type, user-specified data, status, device fields and qualified job name parameter to subset the list of all the spooled files.

Note: When using filtering information format OSPF0100, the first 10 characters contain the user name, and the next 2 characters are reserved.

The following special values can be used for the user name to filter on:


User-specified data. Only spooled files whose user-specified data or file name match this value are included in the list. This field can be used in conjunction with the user, output queue and library, form type, status, device fields and qualified job name parameter to subset the list of all the spooled files.

The special value supported is:


Error Messages



API introduced: V3R6

[ Back to top | Print APIs | APIs by category ]