Translate Data Stream (QD0TRNDS) API

  Required Parameter Group:

1 Translation session handle Input Char(16)
2 To buffer Output Char(*)
3 To buffer output length Output Binary(4)
4 To buffer length Input Binary(4)
5 To buffer type Input Char(10)
6 From buffer Input Char(*)
7 From buffer length Input Binary(4)
8 From buffer type Input Char(10)
9 Operation Input Char(1)
10 Error code I/O Char(*)

  Default Public Authority: *USE

  Threadsafe: No

The Translate Data Stream (QD0TRNDS) API translates data from one format to another format. The data formats depend on the parameter values you specify.


Authorities and Locks

None.


Required Parameter Group

Translation session handle
INPUT; CHAR(16)

The name of the translation session. This name is returned to your application following the call to the QD0STRTS API.

To buffer
OUTPUT; CHAR(*)

The buffer used to contain the output of the data stream translation. This value should be large enough to contain the expected results.

To buffer output length
OUTPUT; BINARY(4)

The length of the translated data that is placed in the to buffer parameter.

To buffer length
INPUT; BINARY(4)

The length of the buffer that is available for output.

To buffer type
INPUT; CHAR(10)

The type of data to be put into the to buffer parameter. The possible values are:

5250 Create a 5250 data stream
3270 Create a 3270 data stream
3270RB Create a 3270 data stream for the data stream that is expected in response to a 3270 Read Buffer command
*FORMAT Create a formatted buffer for the data. See the SNA Upline Facility Programming, SC41-5446, manual to determine the format of the buffer header.

See Valid Parameter Combinations for a list of the allowable combinations of this parameter with the operations and from buffer type parameters.

From buffer
INPUT; CHAR(*)

The buffer that contains the data to be translated.

From buffer length
INPUT; BINARY(4)

The length of the data contained in the from buffer parameter.

From buffer type
INPUT; CHAR(10)

The type of data that is contained in the from buffer parameter. The possible values are:

5250 Contains a 5250 data stream
5250RS Contains a 5250 data stream that results from a 5250 Read Screen command
5250RSE Contains a 5250 data stream that results from a 5250 Read Screen with Extended Attributes command
3270 Contains a 3270 data stream
*FORMAT Contains a formatted buffer for the data. See the SNA Upline Facility Programming manual, SC41-5446, to determine the format of the buffer header.

See Valid Parameter Combinations for a list of the allowable combinations of this parameter with the operations and to buffer type parameters.

Operation
INPUT; CHAR(1)

Indicates whether the data to be translated is input or output data. You can specify the following values:

I The data to be translated is for an input operation
O The data to be translated is for an output operation

See Valid Parameter Combinations for a list of the allowable combinations of this parameter with the to buffer type and from buffer type parameters.

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 lists the valid combinations of the from buffer type, to buffer type, and operations parameters.

Valid Parameter Combinations

Operation From BufferType To BufferType
O 3270 *FORMAT
O 3270 5250
O *FORMAT 5250
I 5250 *FORMAT
I 5250 3270
I *FORMAT 3270
I 5250RS 3270RB
I 5250RSE 3270RB


Error Messages

Message ID Error Message Text
CPF3C90 E Literal value cannot be changed.
CPF3CF1 E Error code parameter not valid.
CPF5D53 E To and from buffers overlap.
CPF5D54 E Value &1 for operation parameter not valid.
CPF5D55 E Value &1 is not valid for the To buffer type parameter.
CPF5D56 E Value &1 is not valid for the From buffer type parameter.
CPF5D57 E Combination of parameter values not valid.
CPF5D58 E Translation session handle parameter value not valid.
CPF5D59 E Value &1 for from buffer length parameter not valid.
CPF5D5A E Value &1 for the to buffer length parameter not valid.
CPF5D5C E 3270 data stream in from buffer not valid.

An error was found while translating the 3270 data stream in the from buffer. The error code for translation was &1.

X'0002' A 3270 command or order that is not supported or not valid was detected in the data stream.
X'0003' A parameter or address that is not valid was detected in the 3270 data stream.
X'0004' Excess fields were detected in the data stream. A certain number of these fields are allowed based on the device specified on the QD0STRTS call. This number of fields was exceeded.
X'0021' A set buffer address order is missing after a row-column AID code.
X'0863' A character set attribute that is not valid was found in the data stream.

CPF5D5D E 5250 data stream in from buffer not valid.

An error was found while translating the 5250 data stream in the from buffer. The error code for the translation was &1.

X'0001' A 5250 AID code that was not correct was found in the data stream.
X'0020' A cursor position that was not valid was detected in the 5250 data stream.
X'0021' A set buffer address order is missing after a row-column AID code.
X'0022' A set buffer address order that was not valid was found in the data stream.
X'D030' A data stream resulting from a Read Screen with Extended Attributes command was specified for a display device that does not support extended attributes.

CPF5D5E E Return code in formatted buffer indicates error. Codes returned in this message are listed in SNA Upline Facility Programming, SC41-5446.
CPF5D5F E Data integrity error in from buffer. The error code for the translation was &1. The possible error codes are:

X'0023' Character not valid.
X'0050' Shift out (X'0E') and shift in (X'0F') not correctly balanced in a DBCS session.
X'0051' Shift out (X'0E') and shift in (X'0F') in a DBCS field.
X'0052' The dead position in a DBCS field is not null.
X'0053' A DBCS character is not valid.

CPF5D60 E To buffer not large enough for translation output.
CPF5D62 E Error occurred in translation routines.
CPF5D63 E Data integrity error in formatted buffer. The error code for the translation was &1. The possible error codes are:

X'0023' Character not valid.
X'0050' Shift out (X'0E') and shift in (X'0F') not correctly balanced in a DBCS session.
X'0051' Shift out (X'0E') or shift in (X'0F') in a DBCS field.
X'0052' The dead position in a DBCS field is not null.
X'0053' A DBCS character is not valid.

CPF5D64 E To buffer length not valid for to buffer.
CPF5D65 E From buffer length not valid for from buffer.
CPF5D67 E Severe error occurred while addressing parameter list.
CPF9872 E Program or service program &1 in library &2 ended. Reason code &3.


API introduced: V2R2

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