Retrieve Printer Attributes (QGYRPRTA) API


  Required Parameter Group:

1 Receiver variable Output Char(*)
2 Length of receiver variable Input Binary(4)
3 Format name Input Char(8)
4 Device name Input Char(10)
5 Error Code I/O Char(*)

  Default Public Authority: *USE

  Threadsafe: No

The Retrieve Printer Attributes (QGYRPRTA) API retrieves attributes about a specific printer device. The output returned varies depending on whether the writer is started or not.


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.

Format name
INPUT; CHAR(8)

The format of the printer attributes being returned. The valid format is RPTA0100.

Device name
INPUT; CHAR(10)

The name of the printer device for which information should be retrieved.

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 table describes the order and format of the data that is returned in the receiver variable.


RPTA0100 Format

Offset Type Field
Dec Hex
0 0 BINARY(4) Bytes returned
4 4 BINARY(4) Bytes available
8 8 CHAR(10) Device name
18 12 CHAR(1) Writer started
19 13 CHAR(1) Writer status
20 14 BIN(4) Device status
24 18 BIN(4) Overall status
28 1C CHAR(50) Text description
78 4E CHAR(2) Reserved
80 50 CHAR(10) Started by user
90 5A CHAR(1) Writing status
91 5B CHAR(1) Waiting for message status
92 5C CHAR(1) Held status
93 5D CHAR(1) End pending status
94 5E CHAR(1) Hold pending status
95 5F CHAR(1) Between files status
96 60 CHAR(1) Between copies status
97 61 CHAR(1) Waiting for data status
98 62 CHAR(1) Waiting for device status
99 63 CHAR(1) On job queue status
100 64 CHAR(4) Reserved
104 68 CHAR(10) Writer job name
114 72 CHAR(10) Writer job user name
124 7C CHAR(6) Writer job number
130 82 CHAR(10) Printer device type
140 8C BINARY(4) Number of separators
144 90 BINARY(4) Drawer for separators
148 94 CHAR(10) Align forms
158 9E CHAR(10) Output queue name
168 A8 CHAR(10) Output queue library name
178 B2 CHAR(1) Output queue status
179 B3 CHAR(1) Network directory publishing status
179 B3 CHAR(1) Reserved
180 B4 CHAR(10) Form type
190 BE CHAR(10) Message option
200 C8 CHAR(10) Automatically end writer
210 D2 CHAR(10) Allow direct printing
220 DC CHAR(10) Message queue name
230 E6 CHAR(10) Message queue library name
240 F0 CHAR(2) Reserved
242 F2 CHAR(10) Changes take effect
252 FC CHAR(10) Next output queue name
262 106 CHAR(10) Next output queue library name
272 110 CHAR(10) Next form type
282 11A CHAR(10) Next message option
292 124 BINARY(4) Next file separators
296 128 BINARY(4) Next separator drawer
300 12C CHAR(10) Spooled file name
310 136 CHAR(10) Job name
320 140 CHAR(10) User name
330 14A CHAR(6) Job number
336 150 BINARY(4) Spooled file number
340 154 BINARY(4) Page being written
344 158 BINARY(4) Total pages
348 15C BINARY(4) Copies left to produce
352 160 BINARY(4) Total copies
356 164 CHAR(10) Advanced Function Presentation™
366 16E CHAR(4) Message key
370 172 CHAR(11) Reserved
381 17D CHAR(8) Job system name
389 185 CHAR(7) Spooled file create date
396 18C CHAR(6) Spooled file create time


Field Descriptions

Advanced Function Presentation. Whether the printer supports Advanced Function Presentation.

*NO Advanced Function Presentation is not supported
*YES Advanced Function Presentation is supported

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

Possible values are:

*WTR The writer determines when the message is sent.
*FILE Control of the page alignment is specified by each file.

Allow direct printing. Whether the printer writer allows the printer to be allocated to a job that prints directly to a printer.

*NO Direct printing is not allowed
*YES Direct printing is allowed.

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

*NORDYF When no files are ready to print on the output queue from which the writer is selecting files to be printed.
*FILEEND When the current spooled file has been printed.
*NO The writer will not end, but it will wait for more spooled files.

Between copies status. Whether the writer is between copies of a multiple copy spooled file. 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. 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.

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

Possible values are:

*NORDYF When all the current eligible files are printed.
*FILEEND When the current spooled file is done printing.
Blank No pending changes to the writer.

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

Device name. The name of the printer device.

Device status. The status of the printer device.

Possible values are:

Status Numeric Code (decimal) Overall Status
0 VARIED OFF
5 AS/36 DISABLED
10 VARY OFF PENDING
20 VARY ON PENDING
30 VARIED ON
40 CONNECT PENDING
50 SIGNON DISPLAY
60 ACTIVE
62 AS/36 ENABLED
63 ACTIVE READER
66 ACTIVE WRITER
70 HELD
75 POWERED OFF
80 RCYPND
90 RCYCNL
95 SYSTEM REQUEST
100 FAILED
103 FAILED READER
106 FAILED WRITER
110 DIAGNOSTIC MODE
111 DAMAGED
112 LOCKED
113 UNKNOWN

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


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

Possible values are:

-1 *FILE: The separator page prints from the same drawer that the file is printed from. If you specify a drawer different from the file that contains colored or different type paper, the page separator is more identifiable.
-2 *DEVD: The separator pages will print from the separator drawer specified in the printer device description.
1 The first drawer.
2 The second drawer.
3 The third drawer.

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

Possible values are:

N No ENDWTR command was issued.
I *IMMED: The writer ends as soon as its output buffers are empty.
C *CNTRLD: The writer ends after the current copy of the spooled file has been printed.
P *PAGEEND: The writer ends at the end of the page.

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

Possible values are:

*ALL The writer is started with the option to print all spooled files of any form type.
*FORMS The writer is started with the option to print all the spooled files with the same form type before using a different form type.
*STD The writer is started with the option to print all the spooled files with a form type of *STD.
form type name The writer is started with the option to print all the spooled files with the form type you specified.

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:

N No HLDWTR command was issued.
I *IMMED: The writer is held as soon as its output buffers are empty.
C *CNTRLD: The writer is held after the current copy of the file has been printed.
P *PAGEEND: The writer is held at the end of the page.

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 ran. This field is blank when no spooled file is printing.

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

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

Possible values are:

*MSG A message is sent to the message queue.
*NOMSG No message is sent to the message queue.
*INFOMSG An informational message is sent to the message queue.
*INQMSG An inquiry message is sent to the message queue.

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.

Network directory publishing status. Whether the printer is published in the network directory.

Possible values are:

0 Printer is not published
1 Printer is published

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

Possible values are:

-1 *FILE: The number of separator pages is specified by each file.
-10 No pending change to the writer.
Number of separators The number of separator pages to be printed.

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

Possible values are:

*ALL The writer is changed with the option to print all spooled files of any form type.
*FORMS The writer is changed with the option to print all the spooled files with the same form type before using a different form type.
*STD The writer is changed with the option to print all the spooled files with a form type of *STD.
Form type name The writer is changed with the option to print all the spooled files with the form type name you specified.
Blank No change has been made to this writer.

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

Possible values are:

*MSG A message is sent to the message queue.
*NOMSG No message is sent to the message queue.
*INFOMSG An informational message is sent to the message queue.
*INQMSG An inquiry message is sent to the message queue.
Blank No change pending.

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:

-1 *FILE: Separator pages print from the same drawer that the spooled file prints from. If you specify a drawer different from the spooled file that contains colored or different type paper, the page separator is more identifiable.
-2 *DEVD: Separator pages print from the separator drawer specified in the printer device description.
-10 No pending change to the writer.
1 The first drawer.
2 The second drawer.
3 The third drawer.

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

Possible values are:

-1 *FILE: The number of separator pages is specified by each file.
Number of separators The number of separator pages to be printed.

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:

H The output queue is held.
R The output queue is released.

Overall status. The overall status of the logical printer.

Possible values are:

1 Unavailable
2 Powered off or not yet available
3 Stopped
4 Message waiting
5 Held
6 Stop (pending)
7 Hold (pending)
8 Waiting for printer
9 Waiting to start
10 Printing
11 Waiting for printer output
12 Connect pending
13 Powered off
14 Unusable
15 Being serviced
999 Unknown

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 type. The type of the printer being used to print the spooled file.

Valid values are:

*SCS SNA (Systems Network Architecture) character string
*IPDS™ Intelligent Printer Data Stream™

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:

C Century, where 0 indicates years 19xx and 1 indicates years 20xx.
YY Year
MM Month
DD Day

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:

HH Hour
MM Minutes
SS Seconds

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.

Text description. The text description of the printer device.

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

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

Possible values are:

Number The number of pages in the spooled file.
0 No spooled file is printing.

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:

N The writer is not waiting for more data.
Y The writer has written all the data currently in the spooled file and is waiting for more data. This condition occurs when the writer is producing an open spooled file with SCHEDULE(*IMMED) specified.

Waiting for device status. Whether the writer is waiting to get the device from a job that is printing directly to the printer.

N The writer is not waiting for the device.
Y The writer is waiting for the device

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.

Writer started. Whether or not a writer is started for this printer.

Possible values are:

0 No writer is started
1 Writer is started

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

Possible values are:

X'01' Started
X'02' Ended
X'03' On job queue
X'04' Held
X'05' Message waiting

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

Possible values are:

Y The writer is in writing status.
N The writer is not in writing status.
S The writer is writing the file separators.

Error Messages

Message ID Error Message Text
CPF24B4 E Severe error while addressing parameter list.
CPF3C90 E Literal value cannot be changed.
CPF3CF1 E Error code parameter not valid.
CPF3313 E Writer &1 not active nor on job queue.
CPF33C8 E No writer information returned for printer &1.
CPF9800 E All CPF98xx messages could be signaled. xx is from 01 to FF.
CPF9872 E Program or service program &1 in library &2 ended. Reason code &3.

API introduced: V3R6

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