ibm-information-center/dist/eclipse/plugins/i5OS.ic.nls_5.4.0.1/rbagscanlengthrepdatachng.htm

60 lines
3.9 KiB
HTML
Raw Normal View History

2024-04-02 14:02:31 +00:00
<?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="concept" />
<meta name="DC.Title" content="Can the length of *CCHAR replacement data change?" />
<meta name="abstract" content="The length of *CCHAR replacement data can change. This is why *CCHAR replacement data is required to be a variable-length field." />
<meta name="description" content="The length of *CCHAR replacement data can change. This is why *CCHAR replacement data is required to be a variable-length field." />
<meta name="DC.Relation" scheme="URI" content="rbagshandmsgccsidsupquest.htm" />
<meta name="copyright" content="(C) Copyright IBM Corporation 1998, 2006" />
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 1998, 2006" />
<meta name="DC.Format" content="XHTML" />
<meta name="DC.Identifier" content="rbagscanlengthrepdatachng" />
<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>Can the length of *CCHAR replacement data change?</title>
</head>
<body id="rbagscanlengthrepdatachng"><a name="rbagscanlengthrepdatachng"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">Can the length of *CCHAR replacement data change?</h1>
<div><p>The length of *CCHAR replacement data can change. This is why *CCHAR
replacement data is required to be a variable-length field.</p>
<p>The length of the field grows when converting from an SBCS CCSID to the
UCS-2 Level-1 CCSID. The length of the field shrinks when converting
from the UCS-2 Level-1 CCSID to an SBCS CCSID.</p>
<p>For example, you define message description TST0011 as 'Printer &amp;1;
has error &amp;2;' in message file MYMSGF that has a CCSID of 65535. '&amp;1'
is defined as *CCHAR data (*VARY 2) in length. This is the name of the printer.
<var class="varname">&amp;2</var>; is defined as a *CHAR data with a length of 1.
This is an error code. Enter the following Send Program Message command to
send this message to message queue MYMSGQ:</p>
<pre>SNDPGMMSG MSGID(TST0011) MSGF(MYLIB/MYMSGF) TOMSGQ(MYLIB/MYMSGQ) +
MSGDTA(X'000400500030F1') CCSID(61952)</pre>
<p>X'0004' is the length of the variable *CCHAR data. X'00500030' represents
the characters P0 in CCSID 61952. If message queue MYMSGQ has a CCSID of 00037,
the replacement data is converted to X'0002D7F0F1' before it is sent to the
message queue. If message queue MYMSGQ has a CCSID of 65535, the data is not
converted when it is sent to the message queue.</p>
<p>Your application programs cannot hard-code the position of the return code
in this example. When message queue MYMSGQ has a CCSID of 00037, the return
code is 5 bytes into the message text. When message queue MYMSGQ has a CCSID
of 65535, the return code is 7 bytes into the message text.</p>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="rbagshandmsgccsidsupquest.htm" title="Here are some common questions asked about CCSID support for handling messages.">Common questions about CCSID support for handling messages</a></div>
</div>
</div>
</body>
</html>