Add Print Application (QUIADDPA) API


  Required Parameter Group:

1 Application handle Input Char(8)
2 Qualified printer file name Input Char(20)
3 Alternative file name Input Char(10)
4 Share open data path Input Char(1)
5 User data Input Char(10)
6 Error code I/O Char(*)

  Optional Parameter Group:

7 Open data receiver Output Char(*)
8 Length of open data receiver Input Binary(4)
9 Length of available open data Output Binary(4)

  Default Public Authority: *USE

  Threadsafe: No

The Add Print Application (QUIADDPA) API enables print functions in a previously opened display application by opening the printer file for the application. The QUIADDPA API and the Remove Print Application (QUIRMVPA) API are used in pairs to add and remove printing from applications.

Because the QUIADDPA API requires an open application for display, this print function does not work in a batch environment. For printing in batch, use the Open Print Application (QUIOPNPA) API.


Authorities and Locks

Library Authority
*READ
Printer Device File Authority
*USE
Printer Device File Lock
*SHRNUP

Required Parameter Group

Application handle
INPUT; CHAR(8)

The application handle assigned by the UIM and returned to the application program by the Open Display Application (QUIOPNDA) API when the application is opened.

Qualified printer file name
INPUT; CHAR(20)

The name of the printer device file used for print operations. The first 10 characters contain the name of the *FILE object, and the second 10 characters contain the name of the library in which the printer device file resides. These special values can be used for the library name:

*CURLIB The job's current library
*LIBL The library list

The user must have *USE authority to the file named by this parameter.

Alternative file name
INPUT; CHAR(10)

An alternative name for the spooled file. The following special value can be used:

*NONE There is no alternative name for the spooled file. The name of the spooled file is the name of the printer device file.

Share open data path
INPUT; CHAR(1)

Indicates whether or not the open data path (ODP) for the printer file is shared. Sharing the ODP allows multiple UIM applications to print to the same spooled file. One of the following values must be used:

Y The ODP is shared.
N The ODP is not shared.
F Use the share value of the printer file.

User data
INPUT; CHAR(10)

User data associated with the spooled file. This data becomes an attribute of the spooled file. The following special values can be used:

*FILE The user data of the spooled file will be set to the user data value of the printer file being opened.
*NONE There is no user data associated with the spooled file. The user data value of the printer file being opened will be set to blanks.

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

Open data receiver
OUTPUT; CHAR(*)

The variable that is to receive the open data information requested. For the format of the open data receiver variable, see Format of Data Returned.

Length of open data receiver
INPUT; BINARY(4)

The amount of data the application program is prepared to receive. If the length specified is larger than the amount of data available, the receiver is not changed beyond the amount of data available. If the length specified is larger than the actual length of the open data receiver parameter, unpredictable results may occur.

Length of available open data
OUTPUT; BINARY(4)

The length of all open data available. All available open data is returned if enough space is provided.


Format of Data Returned

The format of the data available, returned in the open data receiver parameter, is as follows:

CHAR(1)
Whether or not an error occurred while attempting to obtain the conversion tables needed to process the panel group. The conversion tables are needed when the CHRID attribute of the panel group is not equal to the CHRID attribute of the device, or when the CHRID attribute of the panel group is *JOBCCSID and the job CCSID is not equal to the device CHRID. A CPD6A2A diagnostic message will be logged in the job log for each conversion table that is not found.

One of the following values is returned:

N No error occurred while obtaining the conversion tables or the conversion tables were not necessary.
Y An error occurred while obtaining the conversion tables.

CHAR(1)
Whether or not the conversion of data from the job to the device and from the device to the job will result in loss of fidelity of the data. Conversion will be done when the CHRID attribute of the panel group is not equal to the CHRID attribute of the device, or when the CHRID attribute of the panel group is *JOBCCSID and the job CCSID is not equal to the device CHRID.

One of the following values is returned:

N No loss of fidelity will occur.
Y Loss of fidelity may occur on the conversions.

Error Messages

Message ID Error Message Text
CPF3C90 E Literal value cannot be changed.
CPF6A0B E Application handle &3 not valid.
CPF6A0C E Application domain error for application &1.
CPF6A0F E Previous error occurred while running application &3.
CPF6A1A E Application already has an open print file.
CPF6A1C E Unable to add print function.
CPF6A1E E Object cannot be used with this device or print file.
CPF6A11 E Value is not correct. Reason code is &3.
CPF6A20 E Print code page not identical to display code page.
CPF6A24 E Parameter &1 not passed correctly.
CPF6A25 E Return code length of &1 not valid.
CPF6A3A E Value for Open Data Receiver is not valid. Reason code &1
CPF9850 E Override of printer file &1 not allowed.
CPF9872 E Program or service program &1 in library &2 ended. Reason code &3.


API introduced: V2R2
Top | User Interface Manager (UIM) APIs | APIs by category