Open List of Printers (QGYRPRTL) API


  Required Parameter Group:


  Default Public Authority: *USE

  Threadsafe: No

The Open List of Printers (QGYRPRTL) API generates a list of printers on the system and information about the printers. The list can include all printers on the system, a specific list of printers, or the printers for a single output queue. The list will be sorted by printer name.

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, then request that the list be built synchronously.

For more information, see Process Open List APIs.


Authorities and Locks

None.


Required Parameter Group

Receiver variable
OUTPUT; CHAR(*)

The receiver variable that receives the information requested. You can specify the size of the area to be smaller than the format requested as long as you specify the length parameter correctly. As a result, the API returns only the data that the area can hold.

Length of receiver variable
INPUT; BINARY(4)

The length of the receiver variable provided. The length of receiver variable parameter may be specified up to the size of the receiver variable specified in the user program. If the length of receiver variable parameter specified is larger than the allocated size of the receiver variable specified in the user program, the results are not predictable. The minimum length is 8 bytes.

List information
OUTPUT; CHAR(80)

The variable used to return status information about the list of printers that were opened. 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 the filtering and sorting is done.

If the value zero is specified, only the list information is returned and no actual list entries are returned.

Filter information
INPUT; CHAR(*)

The information in this parameter is used to determine which printers to include in the list. Printers can be filtered based on printer name, output queue name, or both. See Format of Filter Information for a description of the layout of this parameter.

Format name
INPUT; CHAR(8)

The format of the printer information being returned.

You must specify one of the following:


Error code
I/O; CHAR(*)

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


Format of Receiver Variable

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


Format PRTL0100



Format PRTL0200



Field Descriptions

Current file name. The name of the spooled file currently being processed by the writer. This field is blank when no file is printing.

Current file user. The name of the user who owns the spooled file currently being processed by the writer. This field is blank when no file is printing.

Current file user-specified data. The user-specified data that describes the file currently being processed by the writer.

Device name. The name of the printer device.

Device status. The status of the printer device using two fields:

Note: Not all of the following values apply to printer devices.


Form type. The type of form being used to print the spooled file.

Possible values are:


Network directory publishing stastus. Whether the printer is published in the network directory. Possible values are:

Output queue library name. The name of the library that contains the output queue from which spooled files are selected for printing.

Output queue name. The name of the output queue from which spooled files are being selected for printing.

Output queue status. The status of the output queue from which spooled files are being selected for printing.

Possible values are:

Overall status. The overall status of the logical printer. Possible values are:


Text description. The text description of the printer device.

Writer name. The name of the writer for this printer.

Writer started. Indication of whether or not a writer is started for this printer. Possible values are:


Writer status. The status of the writer for this printer. Possible values are:


Format of Filter Information


When no filter is to be done, the filter specification must be two BINARY(4) values set to zero.


Field Descriptions

Number of output queues. The total number of output queue names in the output queue name array.


Number of printer names. The total number of printer device names in the printer names array.


Output queue. The name of an output queue to be included in the list.

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

Printer name. The name of a printer to be included in the list.


Error Messages



API introduced: V3R6

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