1 | Output data buffer | Output | Char(*) |
2 | Length of output data returned | Output | Binary(4) |
3 | Remaining data buffer | Output | Char(*) |
4 | Remaining data length | Output | Binary(4) |
5 | Input data buffer | Input | Char(*) |
6 | Length of buffers | Input | Binary(4) |
7 | Truncate length | Input | Binary(4) |
8 | CCSID of input data | Input | Binary(4) |
9 | Error code | I/O | Char(*) |
The Truncate Character Data (QLGTRDTA) API truncates a CCSID-tagged string of character data to a requested length. This API is used to truncate a string of data properly. The string is truncated with respect to the encoding of the data using the encoding scheme of the CCSID. A typical use of this API would be to properly truncate mixed-byte strings for use in a display screen.
This API works in the following manner:
Proper manner means that no multibyte characters are split and no control information is lost. In the situation where characters would be split, the truncation point is re-adjusted to an acceptable position to allow truncation. If control characters are required to be appended to the output, adjustment to the output may be done. For example, if the requested string is in the ISO-2022 encoding scheme, the truncate length requested is reduced by three. This allows for appending the ASCII single-byte escape sequence ('1B2842'X) to the output data returned.
None.
The buffer that receives the properly formed truncated string. This parameter must be the same size as the value specified for the length of buffers parameter.
The number of bytes of data actually returned in the resultant output buffer.
The buffer that receives the data remaining after the truncation has been done. This buffer must be the same size as the input data buffer.
The length of the data remaining after the truncation has been done. This data is the length of the remaining data buffer.
The buffer that holds the input data.
The length of each of the following data buffers:
The maximum size of each data buffer is 32767 bytes.
The maximum length of data to be returned in the output data buffer. Valid values are 1 through 32767.
The CCSID of the data to be truncated. Valid values are 0 through 65533 and 65535. If the CCSID value 0 is provided, the job's default CCSID is used.
If the CCSID tag of the data is not known, a value of 65535 should be used. If the CCSID value is 65535, the data is assumed to be a mixed-byte EBCDIC string that is properly formed.
The supported encoding schemes are single-byte data, mixed-byte EBCDIC data, double-byte data, PC mixed data, ISO-2022 data, and extended UNIX coded-character set (EUC) data. The following specific encoding schemes are supported:
Single-byte data | '1100'X, '2100'X, '3100'X, '4100'X,'4105'X,'4155'X, '5100'X,'5150'X,'6100'X |
Double-byte data | '1200'X, '2200'X, '3200'X,'5200'X,'7200'X |
Mixed EBCDIC data | '1301'X |
Mixed PC data | '2300'X,'3300'X |
ISO-2022 data | '5404'X |
EUC data | '4403'X |
See the Globalization topic in the iSeries Information Center for more information on CCSID values and encoding schemes.
The structure in which to return error information. For the format of the structure, see Error Code Parameter.
Message ID | Error Message Text |
---|---|
CPF24B4 E | Severe error while addressing parameter list. |
CPF2647 E | Buffer length not valid. |
CPF3BC7 E | CCSID &1 outside of valid range. |
CPF3BCA E | CCSID &1 not supported. |
CPF3BCB E | Encoding scheme &1 of CCSID &2 not supported. |
CPF3BCF E | Truncate length not valid. |
CPF3C90 E | Literal value cannot be changed. |
CPF3CF1 E | Error code parameter not valid. |
CPF9872 E | Program or service program &1 in library &2 ended. Reason code &3. |
Top | National Language Support APIs | APIs by category |