70 lines
4.7 KiB
HTML
70 lines
4.7 KiB
HTML
<?xml version="1.0" encoding="UTF-8"?>
|
||
<!DOCTYPE html
|
||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||
<html lang="en-us" xml:lang="en-us">
|
||
<head>
|
||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||
<meta name="security" content="public" />
|
||
<meta name="Robots" content="index,follow" />
|
||
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
|
||
<meta name="DC.Type" content="reference" />
|
||
<meta name="DC.Title" content="Length (positions 30 through 34)" />
|
||
<meta name="abstract" content="Specify the length of the field in these positions. The length of a field containing UTF-16 data can range from 1 through 16 383 code units. The length of a field containing UTF-8 data can range from 1 through 32 766 code units." />
|
||
<meta name="description" content="Specify the length of the field in these positions. The length of a field containing UTF-16 data can range from 1 through 16 383 code units. The length of a field containing UTF-8 data can range from 1 through 32 766 code units." />
|
||
<meta name="DC.Relation" scheme="URI" content="ucs2ap.htm" />
|
||
<meta name="copyright" content="(C) Copyright IBM Corporation 2001, 2006" />
|
||
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 2001, 2006" />
|
||
<meta name="DC.Format" content="XHTML" />
|
||
<meta name="DC.Identifier" content="ucs2length" />
|
||
<meta name="DC.Language" content="en-us" />
|
||
<!-- 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. -->
|
||
<link rel="stylesheet" type="text/css" href="./ibmdita.css" />
|
||
<link rel="stylesheet" type="text/css" href="./ic.css" />
|
||
<title>Length (positions 30 through 34)</title>
|
||
</head>
|
||
<body id="ucs2length"><a name="ucs2length"><!-- --></a>
|
||
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
||
<h1 class="topictitle1">Length (positions 30 through 34)</h1>
|
||
<div><p>Specify the length of the field in these positions. The length
|
||
of a field containing UTF-16 data can range from 1 through 16 383 code
|
||
units. The length of a field containing UTF-8 data can range from 1 through
|
||
32 766 code units.</p>
|
||
<div class="section"><div class="p">When determining the program length of a field
|
||
containing Unicode data, consider the following rules: <ul><li>Each UTF-16 code unit is 2 bytes long.</li>
|
||
<li>The length of the field is specified in the number of UTF-16 code units.
|
||
For example, a field containing 3 UTF-16 code units has 6 bytes of data.</li>
|
||
<li>Each UTF-8 code unit is 1 byte long. A UTF-8 character can be 1, 2, 3,
|
||
or 4 code units in length.</li>
|
||
<li>After converting between Unicode data and EBCDIC, the resulting data should
|
||
be equal to, longer, or shorter than the original length of the data before
|
||
the conversion. For example, 1 UTF-16 code unit is composed of 2 bytes of
|
||
data. That character might convert to 1 single-byte character set (SBCS) character
|
||
composed of 1 byte of data, 1 1 graphic double-byte character set (DBCS) character
|
||
composed of 2 bytes of data, or 1 bracketed DBCS character composed of 4 bytes
|
||
of data. It is, therefore, recommended that, when converting a Unicode field
|
||
(in the physical file) to a field with a different type in the logical file,
|
||
the field in the logical file be defined with the VARLEN keyword. The length
|
||
of the logical file field should be defined large enough to hold the maximum
|
||
size that the Unicode field can be converted to. This will account for the
|
||
expansion that can occur.</li>
|
||
</ul>
|
||
</div>
|
||
<div class="p">On a logical file, if the length is not specified, and a UTF-16
|
||
to EBCDIC conversion will be taking place, the length of the corresponding
|
||
physical file field will be taken, except in the following case: <ul><li>If the physical file field is UTF-16 capable and the logical file field
|
||
has a data type of O, then the length of the logical file field will be 2
|
||
times the field size of the physical file field.</li>
|
||
</ul>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div>
|
||
<div class="familylinks">
|
||
<div class="parentlink"><strong>Parent topic:</strong> <a href="ucs2ap.htm" title="Unicode is a universal encoding scheme for written characters and text that enables the exchange of data internationally. Follow this topic to learn about how to specify DDS position 30 through 37 and position 45 through 80 for describing database files. Positions not mentioned have no special considerations for Unicode.">Unicode considerations for database files</a></div>
|
||
</div>
|
||
</div>
|
||
</body>
|
||
</html> |