ibm-information-center/dist/eclipse/plugins/i5OS.ic.rzakd_5.4.0.1/rzakdmstdfusc2.htm

147 lines
9.0 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="Coded character set identifier keyword" />
<meta name="abstract" content="Use this file-, record-, or field-level keyword to specify that a G-type field supports UTF-16 data instead of DBCS-graphical data. Each UTF-16 code unit (which includes UCS-2 characters) is two bytes long." />
<meta name="description" content="Use this file-, record-, or field-level keyword to specify that a G-type field supports UTF-16 data instead of DBCS-graphical data. Each UTF-16 code unit (which includes UCS-2 characters) is two bytes long." />
<meta name="DC.subject" content="CCSID (coded character set identifier) keyword, Coded character set identifier (CCSID) keyword" />
<meta name="keywords" content="CCSID (coded character set identifier) keyword, Coded character set identifier (CCSID) keyword" />
<meta name="DC.Relation" scheme="URI" content="ucs2kwd.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="rzakdmstdfusc2" />
<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>Coded character set identifier keyword</title>
</head>
<body id="rzakdmstdfusc2"><a name="rzakdmstdfusc2"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">Coded character set identifier keyword</h1>
<div><p>Use this file-, record-, or field-level keyword to specify that
a G-type field supports UTF-16 data instead of DBCS-graphical data. Each UTF-16
code unit (which includes UCS-2 characters) is two bytes long.</p>
<div class="section"><p>The format of the keyword is:</p>
<pre>CCSID(UTF16-CCSID | &amp;UTF16-CCSID-field | *REFC
[*CONVERT | *NOCONVERT]
[alternate-field-length])</pre>
<p>The UTF16-CCSID parameter is
required. Use the UTF16-CCSID parameter to specify a CCSID (coded character
set identifier) that uses the UTF-16 encoding scheme for this field. You can
specify the UTF16-CCSID parameter either as a number up to 5 digits long or
as a program-to-system field. You must define the program-to-system field
with a length of 5 and with the S data type.</p>
<p>You can specify a special
value of *REFC instead of a UTF16-CCSID value. It is only valid on reference
fields, and you must code the referenced field with a CCSID keyword that specifies
a UTF16-CCSID value. Normally, the printer file CCSID keyword overrides any
CCSID keyword attributes taken from the referenced field. If you specify *REFC,
the UTF16-CCSID value comes from the referenced field.</p>
<p>The *CONVERT
parameter is optional and specifies whether the UTF-16 data is converted to
a target CCSID specified on the CHRID parameter of the CRTPRTF, CHGPRTF, or
OVRPRTF commands. *CONVERT is the default. If you specify the CCSID keyword
with *NOCONVERT, the UTF-16 data is not converted to the target CCSID.</p>
<p>If
*NOCONVERT is active for a printer file whose DEVTYPE is *AFPDS, the application
must also use either a TrueType font or one of the AFP™ Unicode migration fonts. If you do not
specify either a TrueType font or one of the AFP Unicode migration fonts, the output will
be interpreted as single-byte data and will probably be unprintable.</p>
<p>If
*NOCONVERT is active for a printer file whose DEVTYPE is *LINE or *AFPDSLINE,
the application must also use one of the AFP Unicode migration fonts. If you do not
specify an AFP Unicode
migration font, the output will be interpreted as single-byte data and will
probably be unprintable.</p>
<p>If *NOCONVERT is active and the file DEVTYPE
is *AFPDS, specify a TrueType font with the FONTNAME keyword, or specify an AFP Unicode
migration font character set and code page with the FNTCHRSET keyword. If
the file DEVTYPE is *LINE or *AFPDSLINE, specify the AFP Unicode migration font character set
and code page in the page definition for the printer file.</p>
<p>If *NOCONVERT
is specified for a printer file whose DEVTYPE is *SCS, a diagnostic message
is issued when the printer file is used, and the UTF-16 data is converted
to the target CCSID.</p>
<p>The alternate-field-length parameter is optional
and is valid only when you specify the CCSID keyword at the field level and
the *CONVERT parameter is active. Specify the alternate-field-length as the
number of UTF-16 code units.</p>
<p>When UTF-16 data is involved in an output
operation and the *CONVERT parameter is active, the data is converted from
the associated UTF-16 CCSID to the target CCSID. Generally, the length of
the data will change when this conversion occurs. Therefore, you can use the
alternate-field-length value to specify a printed field length that is different
from the default printed field length. The default printed field length of
a 'G' data type field is twice the number of characters that are specified
for the field length.</p>
<p>The alternate-field-length value can help avoid
truncation of field data when the data length will be longer after conversion
than the default printed field length. The alternate-field-length value can
also help increase the available line space by limiting the printed field
length when the data length will be shorter after conversion. The field length
will still be used to define the field's output buffer length.</p>
<p>For example,
a printer file contains the following information:</p>
<pre>FLD1 10G 2 2 CCSID(X Y)</pre>
<ul><li>X is the UTF-16 CCSID associated with the field data. Y is the alternate-field-length
of this field. If you did not specify Y, then the default printed field length
of FLD1 is 20 printed positions (twice the number of UTF-16 code units specified
on the field length).</li>
<li>If you know that the UTF-16 data is constructed from single
byte data, you can specify the alternate-field-length, Y, as 5 UTF-16 code
units; FLD1 has a printed field length of 10 printed positions (twice the
number of UTF-16 code units specified on the alternate-field-length).</li>
<li>If you know that the UTF-16 data is constructed from double-byte
data, you can specify the alternate-field-length, Y, as 11 UTF-16 code units;
FLD1 has a printed field length of 22 printed positions (twice the number
of UTF-16 code units specified on the alternate-field-length). This allows
space for the shift-out and shift-in characters.</li>
</ul>
<p>If you specify the CCSID keyword at the field-level and either the
record- or the file-level, the field-level keyword takes precedence. If the
you specify the CCSID keyword at the file- or record-level and no G-type fields
exist, then the keyword is ignored.</p>
<p>On output, field data that is longer
than the specified field length is truncated.</p>
<p>The CCSID keyword is not
valid for files whose DEVTYPE is *IPDS.</p>
<p>You can specify the CCSID keyword
with all keywords that are currently allowed on a G-type field.</p>
<p>Option
indicators are not valid for this keyword.</p>
</div>
<div class="section"><h4 class="sectiontitle">Example</h4><p>The following example shows how to specify
the CCSID keyword.</p>
<pre>|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
00010A CCSID(13488)
00010A R RECORD1
00020A FIELD1 30G
00030A FIELD2 10G CCSID(1200 *CONVERT 6)
00010A R RECORD2 CCSID(1200 *NOCONVERT)
00020A FIELD3 20G
A</pre>
<p>FIELD1 is assigned a CCSID value of 13488. FIELD2 is
assigned a CCSID value of 1200 and has a field length of 6 UTF-16 code units
(12 SBCS characters). FIELD3 is assigned a CCSID value of 1200, and the data
is not converted during an output operation.</p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="ucs2kwd.htm" title="The CCSID keyword for printer files specifies that a G-type field supports UTF-16 data instead of DBCS-graphical data.">Keyword considerations for printer files that use UTF-16 data (positions 45 through 80)</a></div>
</div>
</div>
</body>
</html>