ibm-information-center/dist/eclipse/plugins/i5OS.ic.apis_5.4.0.1/CDRCVRT.htm

694 lines
20 KiB
HTML
Raw Normal View History

2024-04-02 14:02:31 +00:00
<!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>Convert a Graphic Character String (CDRCVRT, QTQCVRT) 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. -->
<!-- Change History: -->
<!-- YYMMDD USERID Change description -->
<!-- NETMG2 SCRIPT A converted by B2H R4.1 (346) (CMS) by HOLTJM at -->
<!-- RCHVMW2 on 29 Jan 1999 at 10:01:37 -->
<!--File Edited December 2001 -->
<!-- End Header Records -->
<link rel="stylesheet" type="text/css" href="../rzahg/ic.css">
</head>
<body>
<!-- Java sync-link -->
<script language="Javascript" src="../rzahg/synch.js" type="text/javascript">
</script>
<a name="Top_Of_Page"></a>
<h2>Convert a Graphic Character String (CDRCVRT, QTQCVRT) API</h2>
<div class="box" style="width: 60%;">
<br>
&nbsp;&nbsp;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="40%">CCSID1</td>
<td align="left" valign="top" width="25%">Input</td>
<td align="left" valign="top" width="25%">Int(4)</td>
</tr>
<tr>
<td align="center" valign="top">2</td>
<td align="left" valign="top">ST1</td>
<td align="left" valign="top">Input</td>
<td align="left" valign="top">Int(4)</td>
</tr>
<tr>
<td align="center" valign="top">3</td>
<td align="left" valign="top">S1</td>
<td align="left" valign="top">Input</td>
<td align="left" valign="top">Char(*)</td>
</tr>
<tr>
<td align="center" valign="top">4</td>
<td align="left" valign="top">L1</td>
<td align="left" valign="top">Input</td>
<td align="left" valign="top">Int(4)</td>
</tr>
<tr>
<td align="center" valign="top">5</td>
<td align="left" valign="top">CCSID2</td>
<td align="left" valign="top">Input</td>
<td align="left" valign="top">Int(4)</td>
</tr>
<tr>
<td align="center" valign="top">6</td>
<td align="left" valign="top">ST2</td>
<td align="left" valign="top">Input</td>
<td align="left" valign="top">Int(4)</td>
</tr>
<tr>
<td align="center" valign="top">7</td>
<td align="left" valign="top">GCCASN</td>
<td align="left" valign="top">Input</td>
<td align="left" valign="top">Int(4)</td>
</tr>
<tr>
<td align="center" valign="top">8</td>
<td align="left" valign="top">L2</td>
<td align="left" valign="top">Input</td>
<td align="left" valign="top">Int(4)</td>
</tr>
<tr>
<td align="center" valign="top">9</td>
<td align="left" valign="top">S2</td>
<td align="left" valign="top">Output</td>
<td align="left" valign="top">Char(*)</td>
</tr>
<tr>
<td align="center" valign="top">10</td>
<td align="left" valign="top">L3</td>
<td align="left" valign="top">Output</td>
<td align="left" valign="top">Int(4)</td>
</tr>
<tr>
<td align="center" valign="top">11</td>
<td align="left" valign="top">L4</td>
<td align="left" valign="top">Output</td>
<td align="left" valign="top">Int(4)</td>
</tr>
<tr>
<td align="center" valign="top">12</td>
<td align="left" valign="top">FB</td>
<td align="left" valign="top">Output</td>
<td align="left" valign="top">Feedback</td>
</tr>
</table>
<br>
&nbsp;&nbsp;Default Public Authority: *USE<br>
<!-- iddvc RMBR -->
<br>
&nbsp;&nbsp;Threadsafe: Yes<br>
<!-- iddvc RMBR -->
<br>
</div>
<p>The Convert a Graphic Character String (CDRCVRT, QTQCVRT) API converts a graphic
character data string of the identified string type (ST1) represented in a
specified <em>from</em> CCSID (CCSID1) to a graphic character data string of
the required string type (ST2) that is represented in another specified <em>
to</em> CCSID (CCSID2).</p>
<p>The function assumes that the entire string to be converted is known and is
passed to the function. Also, the caller has provided sufficient space for the
returned converted string. In case of an overflow situation, an orderly
truncation would result.</p>
<!-- 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>CCSID1</strong></dt>
<dd>INPUT; INT(4)
<p>This variable contains the CCSID value for the input graphic character data
string being converted. The valid range is 1 to 65,533.</p>
</dd>
<dt><strong>ST1</strong></dt>
<dd>INPUT; INT(4)
<p>This variable contains the type of input string. The following types are
defined:</p>
<table cellpadding="3">
<!-- cols="15 85" -->
<tr>
<th align="left" valign="top">Type</th>
<th align="left" valign="top">Explanation</th>
</tr>
<tr>
<td align="left" valign="top"><em>0</em></td>
<td align="left" valign="top">A graphic character string, as semantically defined by
CCSID1.</td>
</tr>
<tr>
<td align="left" valign="top"><em>1</em></td>
<td align="left" valign="top">A graphic character string, as semantically defined by CCSID1,
and null-terminated.</td>
</tr>
</table>
<br>
</dd>
<dt><strong>S1</strong></dt>
<dd>INPUT; CHAR(*)
<p>This variable contains the graphic character data to be converted.</p>
</dd>
<dt><strong>L1</strong></dt>
<dd>INPUT; INT(4)
<p>This variable contains the length (in number of bytes) of:</p>
<ul>
<li>the string to be converted when ST1=0 or<br>
<br>
</li>
<li>the input buffer when ST1=1</li>
</ul>
<p>The valid range is from 1 to 32,767.</p>
</dd>
<dt><strong>CCSID2</strong></dt>
<dd>INPUT; INT(4)
<p>This variable contains the CCSID value for the converted graphic character
data string. The valid range is 1 to 65,533.</p>
</dd>
<dt><strong>ST2</strong></dt>
<dd>INPUT; INT(4)
<p>This variable contains the type of output string. The following types are
defined:</p>
<table cellpadding="3">
<!-- cols="15 85" -->
<tr>
<th align="left" valign="top">Type</th>
<th align="left" valign="top">Explanation</th>
</tr>
<tr>
<td align="left" valign="top"><em>0</em></td>
<td align="left" valign="top">A graphic character string, as semantically defined by
CCSID2.</td>
</tr>
<tr>
<td align="left" valign="top"><em>1</em></td>
<td align="left" valign="top">A graphic character string, as semantically defined by CCSID2,
and null-terminated.</td>
</tr>
<tr>
<td align="left" valign="top"><em>2</em></td>
<td align="left" valign="top">A graphic character string, as semantically defined by CCSID2,
and SPACE-padded.</td>
</tr>
</table>
<br>
</dd>
<dt><strong>GCCASN</strong></dt>
<dd>INPUT; INT(4)
<p>This variable contains a number that identifies which conversion alternative
is to be selected to convert graphic character data from (CCSID1, ST1) to
(CCSID2, ST2). Valid values are:</p>
<table cellpadding="3">
<!-- cols="15 85" -->
<tr>
<th align="left" valign="top">Value</th>
<th align="left" valign="top">Nature of the Conversion Alternative
Selected</th>
</tr>
<tr>
<td align="left" valign="top"><em>0</em></td>
<td align="left" valign="top">Used to select the designated &quot;installation default&quot;
conversion method and tables.</td>
</tr>
<tr>
<td align="left" valign="top"><em>1</em></td>
<td align="left" valign="top">Used to select the CDRA-defined default method and associated
conversion tables. The difference management criterion used in the creation of
the selected tables is based on country or region requirements to serve the majority of
applications using the selected CCSID pairs.</td>
</tr>
<tr>
<td align="left" valign="top"><em>57</em></td>
<td align="left" valign="top">Enforced subset match.</td>
</tr>
</table>
<p><strong>Notes:</strong></p>
<ol>
<li>The values 0 and 1 are treated the same.<br>
<br>
</li>
<li><cite>Character Data Representation</cite>, SC09-1391, contains the
CDRA-defined default conversion tables. This book is not available online,
but can be ordered from the
<a href="http://www.elink.ibmlink.ibm.com/public/applications/publications/cgibin/pbi.cgi?CTY=US" target="_blank">
IBM Publications Center</a><img src="www.gif" alt="Link outside Information Center">.<br><br></li>
</ol>
</dd>
<dt><strong>L2</strong></dt>
<dd>INPUT; INT(4)
<p>This variable contains the byte-length of the allocated area to contain the
converted graphic character data. The valid range is 1 to 32,767.</p>
</dd>
<dt><strong>S2</strong></dt>
<dd>OUTPUT; CHAR(*)
<p>The converted graphic character data. The area's allocated length is given
in L2.</p>
<p>Under certain error conditions the output may contain the results of
converting only a part of the input string.</p>
</dd>
<dt><strong>L3</strong></dt>
<dd>OUTPUT; INT(4)
<p>This variable contains the byte-length of the converted string returned in
S2.</p>
<p>The byte-length includes any null termination or padding characters
necessary to retain the semantics of CCSID2 and ST2.</p>
</dd>
<dt><strong>L4</strong></dt>
<dd>OUTPUT; INT(4)
<p>The implementation of this API does not support the function of this
parameter. This value is always returned as 0.</p>
</dd>
<dt><strong>FB</strong></dt>
<dd>OUTPUT; FEEDBACK
<p>The function returns (in this feedback array) the processing status (and any
associated reason) for this function; the field type is array of three 32-bit
two's complement binary values (12 bytes, or 96 bits); the status code is a
non-negative number in the first 16 bits, and the reason code is a non-negative
number in the second 16 bits. The following are specific meanings of the status
code and associated reason code values (in hexadecimal) contained in the first
32 bits of FB.</p>
</dd>
</dl>
<br>
<h3>Feedback Codes and Conditions</h3>
<table border>
<tr>
<th align="center" valign="top">Status</th>
<th align="center" valign="top">Reason</th>
<th align="left" valign="top">Meaning</th>
</tr>
<tr>
<td align="center" valign="top" width="10%">0000</td>
<td align="center" valign="top" width="10%">0000</td>
<td align="left" valign="top" width="80%">The function completed
successfully.</td>
</tr>
<tr>
<td align="center" valign="top">0001</td>
<td align="center" valign="top">0001</td>
<td align="left" valign="top">Requested conversion is not
supported</td>
</tr>
<tr>
<td align="center" valign="top">0001</td>
<td align="center" valign="top">0005</td>
<td align="left" valign="top">The requested conversion algorithm
specified by GCCASN does not support the specified (CCSID1, ST1) to (CCSID2,
ST2) combination.</td>
</tr>
<tr>
<td align="center" valign="top">0001</td>
<td align="center" valign="top">0006</td>
<td align="left" valign="top">GCCASN value is 0; but an &quot;installation default&quot;
was not found in the GCCST, for the pair (CCSID1, ST1) to (CCSID2, ST2).</td>
</tr>
<tr>
<td align="center" valign="top">0002</td>
<td align="center" valign="top">0001</td>
<td align="left" valign="top">CCSID1 value is 0, which is reserved
to indicate defaulting to a higher level in a hierarchy. The caller must
resolve the default before calling this function.</td>
</tr>
<tr>
<td align="center" valign="top">0002</td>
<td align="center" valign="top">0002</td>
<td align="left" valign="top">CCSID2 value is 0, which is reserved
to indicate defaulting to a higher level in a hierarchy. The caller must
resolve the default before calling this function.</td>
</tr>
<tr>
<td align="center" valign="top">0003</td>
<td align="center" valign="top">0001</td>
<td align="left" valign="top">CCSID1 is 65,535.</td>
</tr>
<tr>
<td align="center" valign="top">0003</td>
<td align="center" valign="top">0002</td>
<td align="left" valign="top">CCSID2 is 65,535.</td>
</tr>
<tr>
<td align="center" valign="top">0004</td>
<td align="center" valign="top">0001</td>
<td align="left" valign="top">The length value in L2 allocated for
area S2 was too small for the output data. A properly truncated and terminated
converted string that fits within the allocated maximum is returned in the area
starting at S2 with its byte-length in L3. The value in L4 is set to 0.</td>
</tr>
<tr>
<td align="center" valign="top">0004</td>
<td align="center" valign="top">0002</td>
<td align="left" valign="top">The encoding scheme of CCSID1 is
X'1301' (mixed Host; single-byte/double-byte encoding). The length value in L2
allocated for area S2 was too small for the output data. A properly truncated
and terminated converted string that fits within the allocated maximum is
returned in the area starting at S2 with its byte-length in L3. The value in L4
is set to 0.</td>
</tr>
<tr>
<td align="center" valign="top">0005</td>
<td align="center" valign="top">0001</td>
<td align="left" valign="top">A pure double-byte CCSID1 was specified and either:
<ul>
<li>ST1=0 and L1 is odd, or</li>
<li>ST1=1 and an orphan byte was found.</li>
</ul>
</td>
</tr>
<tr>
<td align="center" valign="top">0005</td>
<td align="center" valign="top">0004</td>
<td align="left" valign="top">ES of CCSID1 is X'1301', and a
malformed string--an odd number of bytes between SO, SI bracket--was
encountered.</td>
</tr>
<tr>
<td align="center" valign="top">0005</td>
<td align="center" valign="top">0005</td>
<td align="left" valign="top">A null-terminated input string was
specified using ST1=1; however, there was no null-termination character in S1
within the length L1 specified.</td>
</tr>
<tr>
<td align="center" valign="top">0005</td>
<td align="center" valign="top">0006</td>
<td align="left" valign="top">A null-terminated output string was
specified using ST2=1; however, the output string contains one or more
characters matching the null-termination character, resulting from using the
selected conversion tables and methods.</td>
</tr>
<tr>
<td align="center" valign="top">0005</td>
<td align="center" valign="top">0007</td>
<td align="left" valign="top">A SPACE-padded output string was
specified using ST2=2; however, the definition for SPACE character could not be
obtained. The CCSID resource definition did not have an entry for SPACE
character definition, or the CCSID resource definition could not be found.</td>
</tr>
<tr>
<td align="center" valign="top">0005</td>
<td align="center" valign="top">0008</td>
<td align="left" valign="top">A pure double-byte CCSID2 with ST2=1
was specified, and an odd value was specified for length L2 of the output
buffer. The convert function returns only an even number of bytes (maximum L2-1
bytes), including the null-termination character in S2.</td>
</tr>
<tr>
<td align="center" valign="top">0005</td>
<td align="center" valign="top">0009</td>
<td align="left" valign="top">A pure double-byte CCSID2 with ST2=2
(SPACE-padded string) was specified, and an odd value was specified for length
L2 of the output buffer. The convert function returns L2-1 bytes, including the
SPACE-padding characters, in S2.</td>
</tr>
<tr>
<td align="center" valign="top">0005</td>
<td align="center" valign="top">000C</td>
<td align="left" valign="top">ES of CCSID1 is X'1301', and a
trailing SI bracket is missing.</td>
</tr>
<tr>
<td align="center" valign="top">0005</td>
<td align="center" valign="top">000D</td>
<td align="left" valign="top">ES of CCSID1 is X'1301', and a
trailing SI code point was encountered without first encountering its
corresponding leading SO code point (the number of intervening code points may
have been odd or even; the code points would have been treated as single-byte
code points because the leading SO was missing).</td>
</tr>
<tr>
<td align="center" valign="top">0006</td>
<td align="center" valign="top">0001</td>
<td align="left" valign="top">The selection table (GCCST) was not
found.</td>
</tr>
<tr>
<td align="center" valign="top">0006</td>
<td align="center" valign="top">0002</td>
<td align="left" valign="top">A CDRA resource is currently
unavailable.</td>
</tr>
<tr>
<td align="center" valign="top">0006</td>
<td align="center" valign="top">0003</td>
<td align="left" valign="top">The conversion method identified in
the GCCST for the specified selection is currently unavailable.</td>
</tr>
<tr>
<td align="center" valign="top">0006</td>
<td align="center" valign="top">0004</td>
<td align="left" valign="top">A conversion table identified in the
GCCST for the specified selection is not found.</td>
</tr>
<tr>
<td align="center" valign="top">0007</td>
<td align="center" valign="top">0001</td>
<td align="left" valign="top">The system GCCST resource accessed by
the function is found to be invalid in structure.</td>
</tr>
<tr>
<td align="center" valign="top">0007</td>
<td align="center" valign="top">0002</td>
<td align="left" valign="top">The system GCCT resource accessed by
the function is found to be invalid in structure.</td>
</tr>
<tr>
<td align="center" valign="top">0007</td>
<td align="center" valign="top">0003</td>
<td align="left" valign="top">The table type of GCCT does not match
the method selected from GCCST.</td>
</tr>
<tr>
<td align="center" valign="top">0008</td>
<td align="center" valign="top">0001</td>
<td align="left" valign="top">CCSID1 value is not in the range 0 to
65,535.</td>
</tr>
<tr>
<td align="center" valign="top">0008</td>
<td align="center" valign="top">0002</td>
<td align="left" valign="top">CCSID2 value is not in the range 0 to
65,535.</td>
</tr>
<tr>
<td align="center" valign="top">0008</td>
<td align="center" valign="top">0003</td>
<td align="left" valign="top">ST1 value is not in the range 0 to
255.</td>
</tr>
<tr>
<td align="center" valign="top">0008</td>
<td align="center" valign="top">0004</td>
<td align="left" valign="top">ST2 value is not in the range 0 to
255.</td>
</tr>
<tr>
<td align="center" valign="top">0008</td>
<td align="center" valign="top">0005</td>
<td align="left" valign="top">L1 is outside the range permitted by
this implementation.</td>
</tr>
<tr>
<td align="center" valign="top">0008</td>
<td align="center" valign="top">0006</td>
<td align="left" valign="top">L2 is outside the range permitted by
this implementation.</td>
</tr>
<tr>
<td align="center" valign="top">0008</td>
<td align="center" valign="top">0007</td>
<td align="left" valign="top">GCCASN is not in the range 0 to
255.</td>
</tr>
<tr>
<td align="center" valign="top">0100</td>
<td align="center" valign="top">0001</td>
<td align="left" valign="top">One or more input graphic characters
were replaced with a &quot;SUB&quot; character specified for the output string.</td>
</tr>
<tr>
<td align="center" valign="top">0100</td>
<td align="center" valign="top">0002</td>
<td align="left" valign="top">The conversion specified resulted in
character mismatches graphic character(s) in CCSID2.</td>
</tr>
</table>
<br>
<br>
<h3>Usage Notes</h3>
<ol>
<li>Some of the above status and reason code values are possible only when the
method selected and the tables used have the capabilities to indicate that a
character replacement has occurred (using shadow flags or other equivalent
means) or that a substitution with a SUB character was done.<br>
<br>
</li>
<li>When CDRCVRT terminates with a feedback code indicating that the area
allocated for output was insufficient, it is the responsibility of the caller
to ensure that the remaining portion of the input string is semantically
correct prior to making a subsequent call to complete the conversion. For
example, in the case of input data with an encoding scheme of X'1301' (mixed
host SB/DB encoding), an SI is added at the end of the truncated output string
if required; however, no alteration is made to the input string. If a
subsequent call is made with the remainder of the input string, the function
terminates unsuccessfully and an SI is encountered without a leading SO.<br>
<br>
</li>
<li>When the encoding associated with a CCSID is such that all graphic
character code points are a fixed number of bytes (for example, two for pure
double-byte), the assumption is that there are no characters (control or
graphic) with a code point width different from that called for by the encoding
scheme (other than the termination characters appropriate for the specified
input string type) in the input string. The caller is responsible for
filtering out any characters or sequences before calling the function.</li>
</ol>
<hr>
API introduced: V2R2
<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>