Host Print Transform (QWPZHPTR, QwpzHostPrintTransform) API


  Required Parameter Group:


  Default Public Authority: *USE

  Service Program: QWPZHPT1

  Threadsafe: No

The Host Print Transform (OPM, QWPZHPTR; ILE, QwpzHostPrintTransform) API provides an interface to the host print transform (HPT) function. The host print transform transforms SCS or AFP™ data to ASCII data.

USERASCII spooled files will be converted in the same manner as data streams supplied to the Convert Image (QIMGCVTI, QimgCvtImg) API. If the input data stream is not supported, data is returned as if it were in its final form.

For informational purposes, two sample flows are given to show the interaction between the caller and the Host Print Transform API. The first sample flow illustrates the use of the API to transform a spooled file to an ASCII datastream in order to print the file on a printer using a printer device or workstation customization object of type TRANSFORM.

The second sample flow illustrates the use of the API to transform a spooled file to a PDF using a workstation customization object of type CTXFORM.


Authorities and Locks

Device Description Authority
*USE
Device Description Lock
*EXCLRD
Workstation Customization Object Authority
*USE
Workstation Customization Object Library Authority
*EXECUTE
Input Spooled File Authority (Needed when Host Print Transform API reads spooled file)
See Input Spooled File Authorities.

Input Spooled File Authorities

If the Host Print Transform API must read the spooled file such as when transforming to PDF, the requester is authorized to the input spooled file if one or more of the following conditions are met:


Required Parameter Group

Process option
INPUT; BINARY(4)

The action for the host print transform to take. The first option should be initialize (10).

Possible values are:


Option specific input information
INPUT; CHAR(*)

Information that is provided to the Host Print Transform API. For the format and description of this information, see Option Specific Input Information.

Length of option specific input information
INPUT; BINARY(4)

The length of the option specific input information specified in the option specific input information parameter. This length must be either 243 bytes, 273 bytes, or 296 bytes.

Spooled file data buffer
INPUT; CHAR(*)

The spooled file data to be transformed.

Length of spooled file data buffer
INPUT; BINARY(4)

The length of the spooled file data specified in the spooled file data buffer parameter.

Option specific output information buffer
OUTPUT; CHAR(*)

Information that is returned from the Host Print Transform API to the caller. For the format and description of this information, see Option Specific Output Information.

Length of option specific output information buffer
INPUT; BINARY(4)

The size, in bytes, of the option specific output information buffer.

Length of option specific output information available
OUTPUT; BINARY(4)

The length of the option specific output information available. If this length is less than or equal to the length of the option specific output information buffer parameter, all available information has been returned. If this length is greater than the length of the option specific output information buffer parameter, only data up to the length provided is returned in the option specific output information buffer.

Transformed data buffer
OUTPUT; CHAR(*)

Spooled file data that has been transformed by the Host Print Transform API. The data in this buffer can be sent to a printer. Alignment data, if requested, is also returned in the transformed data buffer. The lengths and offsets of the alignment information are returned in the option specific output information buffer parameter. For the format and description of this information, see Option Specific Output Information.

This buffer must be large enough to contain all of the transformed data. As a general rule, this buffer should be twice the size of the length of the spooled file data buffer.

Length of transformed data buffer
INPUT; BINARY(4)

The size, in bytes, of the transformed data buffer.

Length of transformed data available
OUTPUT; BINARY(4)

The length of the transformed data that is available to be returned in the transformed data buffer. If this length is less than or equal to the length of the transform data buffer, all available information has been returned. If this length is greater than the length of the transformed data buffer, only data up to the length provided was returned in the transformed data buffer. The remaining data is lost. An error message, CPF6DF9, is also returned.

Error code
I/O; CHAR(*)

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

The following table presents, in the same order, all the parameters previously described. Each entry indicates whether a parameter will be used by the Host Print Transform API. Y indicates yes and N indicates no.



Option Specific Input Information

The following table shows the structure for the option specific input information parameter. For more details about the fields in the following table, see Field Descriptions.



Field Descriptions

Envelope source. The size of the envelope installed in the envelope source. This field is used only when the value for the printer device name field is *NONE. This field is not used when transforming to PDF. If this field is not specified or the value is not valid, the special value of *MFRTYPMDL is used.

Possible values are:


Note: This field is not validity checked when a name is specified in the printer device name field.

Internal job identifier. The internal job identifier of the job that owns the spooled file. The identifier is not valid following an initial program load (IPL). If you attempt to use it after an IPL, an exception occurs. This field must be blank if a name is given for the qualified job name.

Internal spooled file identifier. The internal spooled file identifier of the spooled file being processed. The identifier is not valid following an initial program load (IPL) or if the spooled file has been moved between auxiliary storage pools (ASPs). If you attempt to use an invalid internal spooled file identifier, an exception occurs. This field must be blank if a name is given for the spooled file name.

Job system name. The name of the system where the job that created the spooled file ran or blank when the spooled file name is *INT. This field is considered after the job name, user name, job number, spooled file name, and spooled file number field requirements have been met.

The possible values are:


When the Length of option specific input information parameter is less than 296 bytes, the API assumes blanks when the spooled file name is *INT. When spooled file name is not *INT,the API assumes *ONLY.

Manufacturer type and model. The manufacturer, type, and model for a printer using transform support. This field must be blank when a printer device name is specified.

Note: This field is only checked for the first process file (20) option received for a session. If this value is to change for a subsequent process file (20) option, a terminate option (50) and an initialize option (10) must be done before the process file (20).

Number of complete pages. The number of complete pages that are contained in the spooled file data input buffer.

Paper source 1. The size of the paper installed in paper source 1. This field is used only when the value for the printer device name field is *NONE. This field is not used when transforming to PDF. If this field is not specified or the value is not valid, the special value of *MFRTYPMDL is used.

Possible values are:


Note: This field is not validity checked when a name is specified in the printer device name field.

Paper source 2. The size of the paper installed in paper source 2. This field is used only when the value for the printer device name field is *NONE. This field is not used when transforming to PDF. If this field is not specified or the value is not valid, the special value of *MFRTYPMDL is used.

Possible values are:

Note: This field is not validity checked when a name is specified in the printer device name field.

Printer device name. The name of the printer device.

Possible values are:

Note: When a device name is specified for this field, the manufacturer type and model must be blank and the work station customizing object name must be *NONE.

Note: This field is only checked for the first process file (20) option received for a session. If this value is to change for a subsequent process file (20) option, a terminate option (50) and an initialize option (10) must be done before the process file (20).

Qualified job name. The qualified job name of the job that owns the spooled file.

The qualified job name has three parts:


Reserved. An ignored field.

Return alignment data. Whether the transform should return data to the caller that can be used for alignment purposes.


Spooled file create date. The date, based on local job time, that the spooled file was created on the system or blank when the spooled file name is *INT. This parameter is considered after the job name, user name, job number, spooled file name, spooled file number, and job system name parameter requirements have been met. The date must be in the CYYMMDD format or one of the following special values:


When the Length of option specific input information parameter is less than 296 bytes, the API assumes blanks when the spooled file name is *INT. When spooled file name is not *INT, the API assumes *ONLY.

Spooled file create time. The time, in local job time, that the spooled file was created on the system. This field must be set to blanks when special values *LAST or *ONLY are used for field Spooled file create date. This field must be set if the spooled file create date has a date specified. This field is considered after the job name, user name, job number, spooled file name, spooled file number, job system name, and spooled file create date field requirements have been met.

The time must be in the HHMMSS format or one of the following special values:


When the Length of option specific input information parameter is less than 296 bytes, the API assumes blanks for this field.

Spooled file name. The name of the spooled file being processed.

You can use this special value for the name:


Spooled file number. The number of the spooled file being processed. The valid range is 1 through 999999.

The following special values are supported for this field:


Note: This field must contain a valid value even if the value for the spooled file name field is *INT.

A value is required because the API performs validity checking on all fields.

Workstation customizing object library. The library containing the workstation customizing object.

Note: This field is only checked for the first process file (20) option received for a session. If this value is to change for a subsequent process file (20) option, a terminate option (50) and an initialize option (10) must be done before the process file (20).

Workstation customizing object name (WSCST). The name of an object that consists of a table of attributes used to customize a given ASCII device. This field must be *NONE when a printer device name is specified.

Possible values are:

Note: This field is only checked for the first process file (20) option received for a session. If this value is to change for a subsequent process file (20) option, a terminate option (50) and an initialize option (10) must be done before the process file (20).


The following table presents, in the same order, all the fields previously described in the option specific input information table. Each entry indicates whether a field will be defined for a particular option. Y indicates yes and N indicates no.



Option Specific Output Information

The following table shows the structure for the option specific output information buffer. This structure is used to pass information from the Host Print Transform API to the caller. For more details about the fields in the following table, see Field Descriptions.



Field Descriptions

Carriage return commands. The carriage return commands contain the data stream commands, which can be used to do end-of-line processing for alignment purposes.

Done transforming file. Indicates the host print transform requires no further data to process the current file. This field should be ignored when the pass input data field is set to 0.


Form feed commands. The form feed commands contain data stream commands, which can be used to do end-of-page processing for alignment purposes.

Length of carriage return commands. The length, in bytes, of the carriage return commands. The carriage return commands are returned in the output specific information.

Length of form feed commands. The length, in bytes, of the form feed commands. The form feed commands are returned in the output specific information.

Length of print data. The length, in bytes, of the print data for the first line of data on the page. This includes any horizontal positioning that is done in the first line.

Length of vertical positioning commands. The length, in bytes, of the vertical positioning commands that are returned in the transformed data buffer.

Offset to carriage return commands. Offset to the carriage return commands in the output specific information. The carriage return commands contain the data stream commands that can be used to do end-of-line processing for alignment purposes.

Offset to form feed commands. Offset to the form feed commands in the output specific information. The form feed commands contain data stream commands that can be used to do end-of-page processing for alignment purposes.

Offset to print data. Offset to the first line of the print data for the page in the transformed data buffer. This first line can be printed for alignment purposes.

Offset to vertical positioning commands. Offset to the vertical positioning commands in the transformed data buffer.

Pass input data. Whether the caller passes the input data to the host print transform .

Possible values are:


Reserved. An ignored field.

Transform file. Whether the spooled file data will be transformed.


The following table presents, in the same order, all the fields previously described in the option specific output information table. Each entry indicates whether a field will be used with a particular option. Y indicates yes and N indicates no.

The length and offset fields describe the format of the transformed data buffer when alignment data has been requested.



Error Messages


API Introduced: V3R7