Retrieve Output Queue Information (QSPROUTQ) API


  Required Parameter Group:


  Default Public Authority: *USE

  Threadsafe: No

The Retrieve Output Queue Information (QSPROUTQ) API returns information about the parameters used to create the queue, the current status of the queue, and the number of entries on the queue.


Authorities and Locks

Output Queue Library Authority
The caller needs *EXECUTE authority to the output queue library.
Output Queue Authority
The caller needs one of the following:
  • *READ authority to the output queue.
  • Job control special authority (*JOBCTL) if the output queue is operator controlled (*OPRCTL(*YES)).
  • Spool control special authority (*SPLCTL).
Output Queue Lock
This API needs an *EXCLRD lock on the output queue.

Required Parameter Group

Receiver variable
OUTPUT; CHAR(*)

The variable that receives the information requested.


Length of receiver variable
INPUT; BINARY(4)

The length of the receiver variable provided by the receiver variable parameter. The amount of data returned is truncated if the receiver variable is too small. A length of less than 8 is not valid. If the length specified is greater than the actual length, the results may be unpredictable.

Format name
INPUT; CHAR(8)

The content and format of the queue information being returned.

You must specify one of the following:


Qualified output queue name
INPUT; CHAR(20)

The name of the output queue for which information is returned. The first 10 characters contain the queue name and the second 10 characters contain the name of the library in which the queue resides.

The following special values are supported for the library name:


Error code
I/O; CHAR(*)

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


OUTQ0100 Format

The following table shows the information returned for the OUTQ0100 format. For more details about the fields in the following table, see Field Descriptions.



OUTQ0200 Format

The following table shows the information returned for the OUTQ0200 format. For more details about the fields in the following table, see Field Descriptions.



Format of Spooled File Maximum Page Entry

Each spooled file size entry has the following structure. For more details about the fields in the following table, see Field Descriptions.



Format of Writer Entry

Each writer entry from format OUTQ0200 has the following structure. For more details about the fields in the following table, see Field Descriptions.



Format of User-Defined Option Entry

Each user-defined option entry has the following structure. For more details about the fields in the following table, see Field Descriptions.



Field Descriptions

Authority to check. Indicates what type of authorities to the output queue allow the user to control all the files on the queue.

The possible values are:


Bytes available. The number of bytes of data available to be returned. All available data is returned if enough space is provided.

Bytes returned. The number of bytes of data returned.

Bytes of user-defined data available. The number of bytes of user-defined data available to be returned. All available data is returned if enough space is provided.

Bytes of user-defined data returned. The number of bytes of user-defined data returned.

Connection type. The type of network connection to the remote system.

Values include:


Data queue library name. The name of the library that contains the data queue.

Data queue name. Name of the data queue associated with this output queue. Whenever a spooled file goes into ready status on the output queue, an entry is placed on the data queue.


Data transform program library name. The name of the library that contains the data transform program.


Data transform program name. The name of the user-specified data transform program that is used by the driver program.

The following values are supported:


Destination options. Destination-dependent options that are specific to a particular implementation of an LPR Print Server.

The possible values are:


Destination type. The type of destination system that spooled files on this output queue are being sent to.

The possible values are:

Display any file. Whether users who have authority to read this output queue can display the output data of any output file on this queue, or only the data in their own files.


Ending time. The ending time portion of the maximum spooled file page entry. It specifies the time of day, in local job time, that the maximum spooled file page is to end. The ending time is given in 24-hour format with a time separator (hh:mm:ss), where hh equals hours, mm equals minutes, and ss equals seconds.

Forms control buffer. The forms control buffer for files sent to a VM/MVS host system.

Note: This information is valid only when the connection type is 1 and the destination type is 3.


Host print transform. Whether to use the host print transform function to transform a spooled file. This field was previously called transform SCS to ASCII.

Values are:


Image configuration. The transform services for a variety of image and print data-stream formats. (See the IMGCFG keyword in the Communications Configuration manual, SC41-5401. This manual is not included in this release of the IBM® i Information Center. However, it is available from the IBM Publications CenterLink outside information center as a printed hardcopy that you can order or in an online format that you can download at no charge.)


Image configuration library. The library in which the image configuration is located. This field is always set to blanks.

Job separators. The number of job separators to be placed at the beginning of the output for each job having spooled file entries on this output queue.


Length of each size entry. The length, in bytes, of each spooled file size entry.

Length of each user-defined option entry. The length, in bytes, of each user-defined option entry.

Length of each writer entry. The length, in bytes, of each writer entry.

Length of user-defined data. The length, in bytes, of the user-defined data.

Long remote printer queue. The name of the remote printer.

Possible values include:


Manufacturer type and model. The manufacturer, type, and model for a printer using the host print transform function.


Message queue library name. The library of the message queue.

Message queue name. The name of the message queue to which messages, created by the remote writer started to this output queue, are sent.


Network directory publishing status. Whether the output queue is published in the network directory.

Possible values include:


Number of files. The number of spooled files that exist on the output queue.

Number of pages. Only files with this number of pages or less will print between the starting and ending times.

Number of spooled file pages specified. In a spooled file, the maximum number of pages allowed on the output queue as determined by the output queue definition from the Create Output Queue (CRTOUTQ) command.

Number of page entries returned. The number of maximum spooled file page entries returned in this format. Only complete entries will be returned.

Number of user-defined options returned. The number of user-defined option entries returned in this format. Only complete entries are returned.

Number of writer entries returned. The number of writer entries returned in this format. Depending on the bytes available, this could be less than the number of writers started. Only complete entries will be returned.

Number of writers started to queue. The number of printer writers that have been started to this output queue.

Offset to maximum spooled file page entries. The offset to the maximum spooled file page entry. A maximum spooled file page entry specifies the requirements a spooled file must meet to be printed from the output queue. The maximum number of pages, the starting time, and the ending time define these requirements.

Offset to user-defined data. The offset to information about the user-defined data.

Offset to user-defined options. The offset to information about each user-defined option entry. Each entry contains the user-defined option.

Offset to writer entries. The offset to information about each writer that is started to the output queue. Each entry contains the writer job name, writer job user name, writer job number, writer job status, and printer device name.

Operator controlled. Whether users with job control authority are allowed to manage or control the files on this queue. Users have job control authority if SPCAUT(*JOBCTL) is specified in their user profile.

The possible values are:


Order of files on queue. The order of the spooled files on the output queue.

The possible values are:


Output queue library name. The name of the library that contains the output queue.

Output queue name. The name of the output queue.

Output queue status. The status of the output queue.

The status may be one of the following values:


Printer device name. The name of the printer device.

For format OUTQ0100 the following applies:

Print separator page. Whether to print a separator page when printing the spooled file on the remote system.

Possible values include:


Remote printer queue. The name of the remote printer.

Possible values include:


Remote system name. The name of the remote system. The format of the name is dependent on the name type. When the remote system name type is 0 (*NONE) or 1 (*PASTHR), the remote system name is blank. When the name type is 2 (system name), the remote system name is up to 255 characters. When the name type is 3 (Internet address), the remote system name is a 15-character address in the form nnn.nnn.nnn.nnn, and the remaining characters are blank.

Remote system name type. The type of remote system name.

Valid values are:


Reserved. An ignored field.

Spooled file auxiliary storage pool attribute. The auxiliary storage pool (ASP) where the spooled files are to reside.

The possible values are:

Spooled file auxiliary storage pool device name. The name of the auxiliary storage pool (ASP) device where the spooled files reside.

The possible values are:


Spooled file auxiliary storage pool ID. The number of the auxiliary storage pool (ASP) where the spooled files reside.

The possible values are:


Spooled file maximum page entries. One maximum page entry is returned for each spooled file maximum page entry defined in the output queue. The number of entries may vary from one output queue to another. See Format of Spooled File Maximum Page Entry for the format of each entry.

Starting time. The starting time portion of the maximum spooled file page array. It specifies the time of day, in local job time, that the maximum spooled file page is to start. The starting time is given in 24-hour format with a time separator (hh:mm:ss), where hh equals hours, mm equals minutes, and ss equals seconds.

Text description. Text that briefly describes the output queue.


User-defined data. Data defined by the user to be used by user applications or user-specified programs that process spooled files.

User-defined object library name. The name of the library that contains the user-defined object.


User-defined object name. The name of the user-defined object that is used by user applications or user-specified programs that process spooled files.

The following values are supported:


User-defined option. The option defined by the user to be used by user applications or user-specified programs that process spooled files. When the number of user-defined options returned is 0, there are no user-defined options.

User-defined option entries. One entry is returned for each user-defined option. The number of entries may vary from one output queue to another. See Format of User-Defined Option Entry for the format of each entry.

User driver program library name. The name of the library that contains the user driver program.


User driver program name. The name of the user-specified driver program that is used to process the spooled files on the output queue.

The following values are supported:


User object type. The type of the user-defined object.

The following values are supported:


Note: A blank value is returned when the name of the user-defined object is *NONE.

VM/MVS class. The VM/MVS SYSOUT class for distributions sent to a VM host system or to a MVS host system.

Possible values are:


Workstation customizing object library name. The library name for the workstation customizing object. This field is blank when the connection type is 1(*SNA) and the user driver program is *NONE.

Workstation customizing object name. The name of an object that consists of a table of attributes used to customize a given ASCII device.

Possible values are:


Writer entries. One writer entry is returned for each writer that is started to the output queue. The number of writer entries may vary from one output queue to another. See Format of Writer Entry for the format of each entry.

Writer job name. The name of the writer job.

The following applies:

Writer job number. The job number associated with the writer job.

The following applies:

Writer job status. The status of the writer job.

The following applies:

The status may be one of the following values.


Writer job user name. The name of the user who started the writer job.

The following applies:

Writers to autostart. The number of remote printer writers to autostart to this output queue at system IPL.

Possible values are:


Writer type started to queue. The type of writer started to this output queue.

Possible values are:



Error Messages



API introduced: V2R2

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