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

134 lines
8.4 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="concept" />
<meta name="DC.Title" content="Retrieve messages" />
<meta name="abstract" content="The Retrieve Message (RTVMSG) command and retrieve message (QMHRTVM) application programming interface (API) have a CCSID-to-convert-to parameter. This parameter determines which CCSID the first- and second-level text is converted to before the text is returned to the user." />
<meta name="description" content="The Retrieve Message (RTVMSG) command and retrieve message (QMHRTVM) application programming interface (API) have a CCSID-to-convert-to parameter. This parameter determines which CCSID the first- and second-level text is converted to before the text is returned to the user." />
<meta name="DC.Relation" scheme="URI" content="rbagsccsidmsgsup2.htm" />
<meta name="DC.Relation" scheme="URI" content="rbagstxtccsidretfld.htm" />
<meta name="DC.Relation" scheme="URI" content="rbagstxtccstaretfld.htm" />
<meta name="DC.Relation" scheme="URI" content="rbagsmdtaccstaretfld.htm" />
<meta name="DC.Relation" scheme="URI" content="../cl/rtvmsg.htm" />
<meta name="DC.Relation" scheme="URI" content="../apis/QMHRTVM.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="rbagsretmsgcomapiccsidsup" />
<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>Retrieve messages</title>
</head>
<body id="rbagsretmsgcomapiccsidsup"><a name="rbagsretmsgcomapiccsidsup"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">Retrieve messages</h1>
<div><p>The Retrieve Message (RTVMSG) command and retrieve message (QMHRTVM)
application programming interface (API) have a CCSID-to-convert-to parameter.
This parameter determines which CCSID the first- and second-level text is
converted to before the text is returned to the user.</p>
<p>The Retrieve Message command and the Retrieve Message API also have a replacement
data CCSID parameter. This parameter communicates the CCSID of the replacement
data to the system. The replacement data CCSID applies only to the parts of
the replacement data that correspond to *CCHAR type data. No other replacement
data is converted.</p>
<p>The Retrieve Message command and Retrieve Message API convert the first-
and second-level text from the CCSID of the message file to the CCSID on the
CCSID-to convert-to parameter. Any replacement data that is *CCHAR data is
converted from the replacement data CCSID to the CCSID-to-convert-to CCSID
before being substituted into the correct replacement variables. The default
for both parameters is *JOB, which means that the CCSID of the job is used.</p>
<div class="section"><h4 class="sectiontitle">Retrieve Message command CCSID return fields</h4><p>Three
CCSID return fields are supported by the Retrieve Message (RTVMSG) command:</p>
<ul><li>TXTCCSID</li>
<li>TXTCCSTA</li>
<li>MDTACCSTA</li>
</ul>
</div>
<div class="section"><h4 class="sectiontitle">Example 1: Retrieve a message with CCSID support</h4><p>Message
file MYMSGF has a CCSID of 65534. The CCSID of the message description is
used to determine the CCSID from which to convert the message text. The CCSID
of the message description (TST0003) is 00037. The first-level text is:</p>
<pre>'MSG #3 is &amp;1;'</pre>
<p>&amp;1
is defined as a *CCHAR variable field with a length of (*VARY 2). Enter the
following RTVMSG (Retrieve Message) command:</p>
<pre>RTVMSG MSGF(MYMSGF) MSGID(TST0003) MSG(&amp;MSG); CCSID(277) +
MDTACCSID(277) MSGDTA(X'0002D6D2')</pre>
<p>In the message data, the
first 2 bytes are a length field with a value of 2. All *VARY fields begin
with a length. The next 2 characters are the actual *CCHAR data with a value
of X'D6D2'. X'D6D2' represents the characters <var class="varname">O</var> and <var class="varname">K</var> on
code page 00277.</p>
<p>The first-level text is converted from CCSID 00037
to CCSID 00277. The replacement data is not converted before it is substituted
for &amp;1; because the replacement data CCSID matches the CCSID-to-convert-to
parameter. As a result, the text returned in the variable &amp;MSG is:</p>
<pre>'MSG #3 is OK.'</pre>
<p>The
code point for the number sign (#) is the only change that occurred in the
conversion. The number sign was converted from code point X'7B' in code page
00037 to code point X'4A' in code page 00277. All other code points in the
text of the message matched in code page 00037 and code page 00277.</p>
<div class="note"><span class="notetitle">Note:</span> If
the CCSID of a message file is 65535, no conversion occurs, even though the
message description CCSID is 00037. The CCSID of the message file always takes
precedence over the message description CCSID.</div>
</div>
<div class="section"><h4 class="sectiontitle">Example 2: Use return fields and converted character
data</h4><p>Message description TST0005 has the following first-level text:</p>
<pre>This is *CHAR &amp;1; This is *CCHAR &amp;2;</pre>
<p>The message description is defined in message file MYMSGF, which has a
CCSID of 65535. &amp;1; is defined as a *CHAR field of length 1. &amp;2; is
defined as a *CCHAR field (*VARY 2) in length. The CCSID of the message description
does not matter because the CCSID of the message file is not 65534. You enter
the following RTVMSG command:</p>
<pre>RTVMSG MSGF(MYMSGF) MSGID(TST0005) MSG(&amp;MSG); CCSID(260) +
MDTACCSID(37) MSGDTA(X'5A00015A') TXTCCSID(&amp;TXTCCSID);</pre>
<div class="note"><span class="notetitle">Note:</span> X'5A'
is the exclamation point (!) on code page 00037.</div>
<p>These are the returned
values from the RTVMSG command:</p>
<ul><li>&amp;MSG = 'This is *CHAR. This is *CCHAR !.' <p>The EBCDIC value of the
*CHAR character is X'5A'. X'5A' appears as an acute accent ( <img src="sd110000.gif" alt="Accent acute character" />) on code page 00260. The *CHAR data did not convert
because only *CCHAR data supports CCSID processing. The '&amp;1' stayed at
X'5A', while '&amp;2' converted to X'4F'. X'4F' is the exclamation point on
code page 00260.</p>
</li>
<li>&amp;TXTCCSID = 65535 <p>The TXTCCSID variable is set to 65535 because
no conversion occurred. When no conversion occurs, the CCSID (if it is not
65534) of the message file is returned.</p>
</li>
</ul>
</div>
</div>
<div>
<ul class="ullinks">
<li class="ulchildlink"><strong><a href="rbagstxtccsidretfld.htm">CCSID of the text returned (TXTCCSID) return field</a></strong><br />
TXTCCSID is the CCSID of the text returned.</li>
<li class="ulchildlink"><strong><a href="rbagstxtccstaretfld.htm">CCSID conversion status indicator (TXTCCSTA) return field</a></strong><br />
TXTCCSTA is the text CCSID conversion status indicator.</li>
<li class="ulchildlink"><strong><a href="rbagsmdtaccstaretfld.htm">Replacement data CCSID conversion status indicator (MDTACCSTA) return field</a></strong><br />
MDTACCSTA is the replacement data CCSID conversion status indicator.</li>
</ul>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="rbagsccsidmsgsup2.htm" title="Use CCSID support for handling messages and message catalogs on i5/OS.">CCSID support for messages</a></div>
</div>
<div class="relref"><strong>Related reference</strong><br />
<div><a href="../cl/rtvmsg.htm">Retrieve Message (RTVMSG) command</a></div>
<div><a href="../apis/QMHRTVM.htm">Retrieve Message (QMHRTVM) API</a></div>
</div>
</div>
</body>
</html>