Retrieve Writer Information (QSPRWTRI) API


  Required Parameter Group:


  Optional Parameter:


  Default Public Authority: *USE

  Threadsafe: No

The Retrieve Writer Information (QSPRWTRI) API retrieves writer information associated with the specified printer or writer. The information retrieved is similar to what can be seen when running the Work with Writer (WRKWTR) command for a particular writer.

Additionally, this API can retrieve information about pending changes to a particular writer. The fields that could contain possible pending changes are:

Changes to these fields result when the Change Writer (CHGWTR) command has been used. The value specified in the Changes take effect field determines when the pending changes take place.


Authorities and Locks

Output Queue Lock
*EXCLRD

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 the area can hold.

Length of receiver variable
INPUT; BINARY(4)

The length of the receiver variable. If the length is larger than the size of the receiver variable, the results are not predictable. The minimum length is 8 bytes.

Format name
INPUT; CHAR(8)

The content and format of the writer information to be returned.

The following format name can be used:


Printer name
INPUT; CHAR(10)

The name of the printer for which writer information is to be returned. The following special value is supported for this parameter:


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

Writer name
INPUT; CHAR(10)

The name of the writer for which writer information is to be returned. The value of this parameter must be set to blanks if the printer name parameter is not set to *WRITER.


WTRI0100 Format

The following information is returned for the WTRI0100 format. See Field Descriptions for more information.


Field Descriptions

Align forms. The time at which the forms alignment message will be sent.

Possible values are:


Allow direct printing. Whether the printer writer allows the printer to be allocated to a job that prints directly to a printer. This field is set to blanks for remote writers.


Automatically end writer. When to end the writer if it is to end automatically.


Between copies status. Whether the writer is between copies of a multiple copy spooled file. This field is set to blanks for remote writers. The possible values are Y (yes) or N (no).

Between files status. Whether the writer is between spooled files. The possible values are Y (yes) or N (no).

Bytes available. Total format data length.

Bytes returned. The length of the data returned.

Changes take effect. The time at which the pending changes to the writer take effect.

Possible values are:


Copies left to produce. The number of copies left to be printed. This field is set to 0 when no file is printing.

Drawer for separators. Identifies the drawer from which the job and file separator pages are to be taken.

Possible values are:


End pending status. Whether an End Writer (ENDWTR) command has been issued for this writer.

Possible values are:


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

Possible values are:


Held status. Whether the writer is held. The possible values are Y (yes) or N (no).

Hold pending status. Whether a Hold Writer (HLDWTR) command has been issued for this writer.

Possible values are:


Initialize printer. How often to initialize the printer device. This field is set to blanks for remote writers.

Possible values are:


Job name. The name of the job that owns the spooled file currently being processed by the writer. This field is blank when no spooled file is printing.

Job number. The number of the job that owns the spooled file currently being processed by the writer. This field is blank when no spooled file is printing.

Job system name. The name of the system where the job that created the spooled file, currently being processed by the writer, ran. This field is blank when no spooled file is printing.

Message key. A key to the message that the writer is waiting for. This field is blank when the writer is not waiting for a reply to an inquiry message.

Message option. Message option for sending a message to the message queue when this form is finished.

Possible values are:


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

Message queue name. The name of the message queue that this writer uses for operational messages.

Next file separators. The next number of separator pages to be printed when the change to the writer takes place.

Possible values are:


Next form type. The name of the next form type to be printed.

Possible values are:


Next message option. The message option for sending a message to the message queue when the next form type is finished.

Possible values are:


Next output queue library name. The name of the library that contains the next output queue. This field is blank if no changes have been made to the writer.

Next output queue name. The name of the next output queue to be processed. This field is blank if no changes have been made to the writer.

Next separator drawer. This value indicates the drawer from which to take the separator pages if there is a change to the writer.

Possible values are:


Number of separators. The number of separator pages to be printed.

Possible values are:


On job queue status. Whether the writer is on a job queue and, therefore, is not currently running. The possible values are Y (yes) or N (no).

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:


Page being written. The page number in the spooled file that is currently being processed by the writer. The page number shown may be lower or higher than the actual page number being printed because of buffering done by the system. This field is set to 0 when no spooled file is printing.

Printer device name. The name of the printer device for which writer information is being returned. This field is set to blanks for remote writers.

Printer device type. The type of the printer being used to print the spooled file. This field is set to blanks for remote writers.

Valid values are:


Reserved. An ignored field.

Spooled file create date. The date, based on local job time, that the spooled file was created on the system. The date is in the CYYMMDD format as follows:


This field is blank when no spooled file is printing.

Spooled file create time. The time, in local job time, that the spooled file was created on the system. The time is in the HHMMSS format where:

This field is blank when no spooled file is printing.

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

Spooled file number. The number of the spooled file currently being processed by the writer. This field is set to 0 when no spooled file is printing.

Started by user. The name of the user that started the writer.

Total copies. The total number of copies to be printed.

Total pages. The total number of pages in the spooled file.

Possible values are:


Type of writer. The type of writer for which writer information is being returned.

Valid values are:


User name. 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.

Waiting for data status. Whether the writer has written all the data currently in the spooled file and is waiting for more data.

Possible values are:


Waiting for device status. Whether the writer is waiting to get the device from a job that is printing directly to the printer. This field is set to blanks for remote writers.


Waiting for message status. Whether the writer is waiting for a reply to an inquiry message. The possible values are Y (yes) or N (no).

Writer job name. The job name of the printer writer.

Writer job number. The job number of the printer writer.

Writer job user name. The name of the system user.

Writing status. Whether the printer writer is in writing status. The

Possible values are:


Error Messages


API introduced: V2R3

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