369 lines
10 KiB
HTML
369 lines
10 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
<meta name="Copyright" content="Copyright (c) 2006 by IBM Corporation">
|
|
<title>Truncate Character Data (QLGTRDTA) API</title>
|
|
<!-- Begin Header Records ========================================== -->
|
|
<!-- All rights reserved. Licensed Materials Property of IBM -->
|
|
<!-- US Government Users Restricted Rights -->
|
|
<!-- Use, duplication or disclosure restricted by -->
|
|
<!-- GSA ADP Schedule Contract with IBM Corp. -->
|
|
<!-- NETMG2 SCRIPT A converted by B2H R4.1 (346) (CMS) by HOLTJM at -->
|
|
<!-- RCHVMW2 on 29 Jan 1999 at 10:01:37 -->
|
|
<!-- Change History: -->
|
|
<!-- YYMMDD USERID Change description -->
|
|
<!--File Edited December 2001 -->
|
|
<!--End Header Records -->
|
|
<link rel="stylesheet" type="text/css" href="../rzahg/ic.css">
|
|
</head>
|
|
<body>
|
|
<a name="Top_Of_Page"></a>
|
|
<!-- Java sync-link -->
|
|
<script language="Javascript" src="../rzahg/synch.js" type="text/javascript">
|
|
</script>
|
|
|
|
<h2>Truncate Character Data (QLGTRDTA) API</h2>
|
|
|
|
<div class="box" style="width: 75%;">
|
|
<br>
|
|
Required Parameter Group:<br>
|
|
<!-- iddvc RMBR -->
|
|
<br>
|
|
<table width="100%">
|
|
|
|
<tr>
|
|
<td align="center" valign="top" width="10%">1</td>
|
|
<td align="left" valign="top" width="50%">Output data buffer</td>
|
|
<td align="left" valign="top" width="20%">Output</td>
|
|
<td align="left" valign="top" width="20%">Char(*)</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td align="center" valign="top">2</td>
|
|
<td align="left" valign="top">Length of output data returned</td>
|
|
<td align="left" valign="top">Output</td>
|
|
<td align="left" valign="top">Binary(4)</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td align="center" valign="top">3</td>
|
|
<td align="left" valign="top">Remaining data buffer</td>
|
|
<td align="left" valign="top">Output</td>
|
|
<td align="left" valign="top">Char(*)</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td align="center" valign="top">4</td>
|
|
<td align="left" valign="top">Remaining data length</td>
|
|
<td align="left" valign="top">Output</td>
|
|
<td align="left" valign="top">Binary(4)</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td align="center" valign="top">5</td>
|
|
<td align="left" valign="top">Input data buffer</td>
|
|
<td align="left" valign="top">Input</td>
|
|
<td align="left" valign="top">Char(*)</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td align="center" valign="top">6</td>
|
|
<td align="left" valign="top">Length of buffers</td>
|
|
<td align="left" valign="top">Input</td>
|
|
<td align="left" valign="top">Binary(4)</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td align="center" valign="top">7</td>
|
|
<td align="left" valign="top">Truncate length</td>
|
|
<td align="left" valign="top">Input</td>
|
|
<td align="left" valign="top">Binary(4)</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td align="center" valign="top">8</td>
|
|
<td align="left" valign="top">CCSID of input data</td>
|
|
<td align="left" valign="top">Input</td>
|
|
<td align="left" valign="top">Binary(4)</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td align="center" valign="top">9</td>
|
|
<td align="left" valign="top">Error code</td>
|
|
<td align="left" valign="top">I/O</td>
|
|
<td align="left" valign="top">Char(*)</td>
|
|
</tr>
|
|
</table>
|
|
<br>
|
|
Default Public Authority: *USE<br>
|
|
<!-- iddvc RMBR -->
|
|
<br>
|
|
Threadsafe: No<br>
|
|
<!-- iddvc RMBR -->
|
|
<br>
|
|
</div>
|
|
|
|
<p>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.</p>
|
|
|
|
<p>This API works in the following manner:</p>
|
|
|
|
<ol>
|
|
<li>Given the truncate length requested for the result, truncate the input data
|
|
in a proper manner to no longer than this value. If the length of the input
|
|
data buffer is less than the requested truncate length, the returned length is
|
|
set to the input length and the data in the input data buffer is placed in the
|
|
resultant output data buffer.
|
|
|
|
<p><strong>Proper manner</strong> 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.</p>
|
|
</li>
|
|
|
|
<li>Place this result into the requested output data buffer and set its length
|
|
in the length of output data returned parameter. Pad the rest of this parameter
|
|
with the appropriate blank characters. When the length of input is less than
|
|
the truncate length, all data is placed in the output data buffer because the
|
|
condition would call for no truncation.<br>
|
|
<br>
|
|
</li>
|
|
|
|
<li>Place the remaining input data (properly formed) into the remaining data
|
|
buffer and set its length in the remaining data length parameter. Properly
|
|
formed data refers to providing a valid string for the type of data being used.
|
|
For example, mixed EBCDIC data must have matched control characters (X'0E' and
|
|
X'0F') around any double-byte character data.</li>
|
|
</ol>
|
|
|
|
<br>
|
|
<!-- Please NOTE: DO NOT DELETE THIS SECTION if this API has no authorities and locks. -->
|
|
<!-- Instead, use the commented out coding below to indicate NONE. -->
|
|
<h3>Authorities and Locks</h3>
|
|
|
|
<!-- Use this if there are no authorities and locks. -->
|
|
<p>None.</p>
|
|
|
|
<br>
|
|
<h3>Required Parameter Group</h3>
|
|
|
|
<dl>
|
|
<dt><strong>Output data buffer</strong></dt>
|
|
|
|
<dd>OUTPUT; CHAR(*)
|
|
|
|
<p>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.</p>
|
|
</dd>
|
|
|
|
<dt><strong>Length of output data returned</strong></dt>
|
|
|
|
<dd>OUTPUT; BINARY(4)
|
|
|
|
<p>The number of bytes of data actually returned in the resultant output
|
|
buffer.</p>
|
|
</dd>
|
|
|
|
<dt><strong>Remaining data buffer</strong></dt>
|
|
|
|
<dd>OUTPUT; CHAR(*)
|
|
|
|
<p>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.</p>
|
|
</dd>
|
|
|
|
<dt><strong>Remaining data length</strong></dt>
|
|
|
|
<dd>OUTPUT; BINARY(4)
|
|
|
|
<p>The length of the data remaining after the truncation has been done. This
|
|
data is the length of the remaining data buffer.</p>
|
|
</dd>
|
|
|
|
<dt><strong>Input data buffer</strong></dt>
|
|
|
|
<dd>INPUT; CHAR(*)
|
|
|
|
<p>The buffer that holds the input data.</p>
|
|
</dd>
|
|
|
|
<dt><strong>Length of buffers</strong></dt>
|
|
|
|
<dd>INPUT; BINARY(4)
|
|
|
|
<p>The length of each of the following data buffers:</p>
|
|
|
|
<ul>
|
|
<li>Input data buffer<br>
|
|
<br>
|
|
</li>
|
|
|
|
<li>Output data buffer<br>
|
|
<br>
|
|
</li>
|
|
|
|
<li>Remaining data buffer</li>
|
|
</ul>
|
|
|
|
<p>The maximum size of each data buffer is 32767 bytes.</p>
|
|
</dd>
|
|
|
|
<dt><strong>Truncate length</strong></dt>
|
|
|
|
<dd>INPUT; BINARY(4)
|
|
|
|
<p>The maximum length of data to be returned in the output data buffer. Valid
|
|
values are 1 through 32767.</p>
|
|
</dd>
|
|
|
|
<dt><strong>CCSID of input data</strong></dt>
|
|
|
|
<dd>INPUT; BINARY(4)
|
|
|
|
<p>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.</p>
|
|
|
|
<p>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.</p>
|
|
|
|
<p>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:</p>
|
|
|
|
<table cellpadding="3">
|
|
<!-- cols="15 85" -->
|
|
<tr>
|
|
<td align="left" valign="top"><em>Single-byte data</em></td>
|
|
<td valign="top">'1100'X, '2100'X, '3100'X, '4100'X,'4105'X,'4155'X,
|
|
'5100'X,'5150'X,'6100'X</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td align="left" valign="top"><em>Double-byte data</em></td>
|
|
<td valign="top">'1200'X, '2200'X, '3200'X,'5200'X,'7200'X</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td align="left" valign="top"><em>Mixed EBCDIC data</em></td>
|
|
<td valign="top">'1301'X</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td align="left" valign="top"><em>Mixed PC data</em></td>
|
|
<td valign="top">'2300'X,'3300'X</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td align="left" valign="top"><em>ISO-2022 data</em></td>
|
|
<td valign="top">'5404'X</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td align="left" valign="top"><em>EUC data</em></td>
|
|
<td valign="top">'4403'X</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<p>See the <a href="../nls/rbagsglobalmain.htm">Globalization</a> topic in the
|
|
iSeries Information Center for more information on CCSID values and encoding
|
|
schemes.</p>
|
|
</dd>
|
|
|
|
<dt><strong>Error code</strong></dt>
|
|
|
|
<dd>I/O; CHAR(*)
|
|
|
|
<p>The structure in which to return error information. For the format of the
|
|
structure, see <a href="../apiref/error.htm#hdrerrcod">Error Code Parameter</a>.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<br>
|
|
<h3>Error Messages</h3>
|
|
|
|
<table width="100%" cellpadding="3">
|
|
<!-- cols="15 85" -->
|
|
<tr>
|
|
<th align="left" valign="top">Message ID</th>
|
|
<th align="left" valign="top">Error Message Text</th>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td align="left" valign="top">CPF24B4 E</td>
|
|
<td valign="top">Severe error while addressing parameter list.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td align="left" valign="top">CPF2647 E</td>
|
|
<td valign="top">Buffer length not valid.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td align="left" valign="top">CPF3BC7 E</td>
|
|
<td valign="top">CCSID &1 outside of valid range.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td align="left" valign="top">CPF3BCA E</td>
|
|
<td valign="top">CCSID &1 not supported.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td align="left" valign="top">CPF3BCB E</td>
|
|
<td valign="top">Encoding scheme &1 of CCSID &2 not supported.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td align="left" valign="top">CPF3BCF E</td>
|
|
<td valign="top">Truncate length not valid.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td align="left" valign="top">CPF3C90 E</td>
|
|
<td valign="top">Literal value cannot be changed.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td align="left" valign="top">CPF3CF1 E</td>
|
|
<td valign="top">Error code parameter not valid.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td align="left" valign="top">CPF9872 E</td>
|
|
<td valign="top">Program or service program &1 in library &2 ended.
|
|
Reason code &3.</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<br>
|
|
|
|
|
|
<hr>
|
|
API introduced: V2R3
|
|
|
|
<hr>
|
|
<center>
|
|
<table cellpadding="2" cellspacing="2">
|
|
<tr align="center">
|
|
<td valign="middle" align="center"><a href="#Top_Of_Page">Top</a> | <a href=
|
|
"nls1.htm">National Language Support APIs</a> | <a href="aplist.htm">APIs by
|
|
category</a></td>
|
|
</tr>
|
|
</table>
|
|
</center>
|
|
</body>
|
|
</html>
|
|
|