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

166 lines
9.8 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="Receive messages" />
<meta name="abstract" content="The Receive Message (RCVMSG) command, the Receive Nonprogram Message (QMHRCVM) API, and the Receive Program Message (QMHRCVPM) API have a CCSID-to-convert-to parameter. This parameter determines which CCSID the text or data is converted to before it is returned to the user." />
<meta name="description" content="The Receive Message (RCVMSG) command, the Receive Nonprogram Message (QMHRCVM) API, and the Receive Program Message (QMHRCVPM) API have a CCSID-to-convert-to parameter. This parameter determines which CCSID the text or data is converted to before it is returned to the user." />
<meta name="DC.Relation" scheme="URI" content="rbagsccsidmsgsup2.htm" />
<meta name="DC.Relation" scheme="URI" content="rbagstxtccsidreturnfield.htm" />
<meta name="DC.Relation" scheme="URI" content="rbagsdtaccsidreturnfield.htm" />
<meta name="DC.Relation" scheme="URI" content="../cl/rcvmsg.htm" />
<meta name="DC.Relation" scheme="URI" content="../apis/Qmhrcvm.htm" />
<meta name="DC.Relation" scheme="URI" content="../apis/QMHRCVPM.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="rbagsrecmsgcomapissup" />
<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>Receive messages</title>
</head>
<body id="rbagsrecmsgcomapissup"><a name="rbagsrecmsgcomapissup"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">Receive messages</h1>
<div><p>The Receive Message (RCVMSG) command, the Receive Nonprogram Message
(QMHRCVM) API, and the Receive Program Message (QMHRCVPM) API have a CCSID-to-convert-to
parameter. This parameter determines which CCSID the text or data is converted
to before it is returned to the user.</p>
<p>The Receive Message command and APIs convert the text or data from the
CCSID of the message queue or message file to the CCSID supplied on the CCSID-to-convert-to
parameter. When replacement data is returned, only the *CCHAR data is converted
from the CCSID of the message queue to the CCSID-to-convert-to value.</p>
<p>If the CCSID of the message file or message queue is 65534, the text or
data is converted from the CCSID of the message description or message to
the CCSID supplied on the CCSID-to-convert-to parameter.</p>
<p>The default for the CCSID-to-convert-to parameter is *JOB, which means
that the CCSID of the job performing the receive operation is used.</p>
<div class="section"><h4 class="sectiontitle">Receive Message command CCSID return fields</h4><p>Two
CCSID return fields are supported by the Receive Message (RCVMSG) command:</p>
<ul><li>TXTCCSID</li>
<li>DTACCSID</li>
</ul>
</div>
<div class="section"><h4 class="sectiontitle">Receive Message API CCSID return fields</h4><p>The Receive
Message (QMHRCVM) API and the Receive Program Message (QMHRCVPM) API support
the return fields defined in TXTCCSID return field for receive message command
and DTACCSID return field for receive message command. The Receive Message
API and the Receive Program Message API also support two additional return
fields.</p>
</div>
<div class="section"><h4 class="sectiontitle">Example 1: Use the CCSID return fields</h4><p>Message description
TST0005 has the following first-level text:</p>
<pre>This is &amp;CHAR &amp;1; This is *CCHAR &amp;2;</pre>
<p>'&amp;1'
is defined as a *CHAR field of length 1. '&amp;2' is defined as a *CCHAR field
(*VARY 2) in length.</p>
<p>Message file MYMSGF has a CCSID of 65534. TST0005
is defined in message file MYMSGF. The message description CCSID is 65535.
The CCSID of message queue MYMSGQ is 65534.</p>
<p>You enter the following
Send Program Message command:</p>
<pre>SNDPGMMSG MSGF(MYMSGF) MSGID(TST0005) CCSID(37) TOMSGQ(MYLIB/MYMSGQ) +
MSGDTA(X'7B00017B')</pre>
<p>The message is not converted when it is
sent to message queue MYMSGQ because the message queue CCSID is 65534. The
message is tagged with CCSID 00037.</p>
<p>You enter the following Receive
Message command to receive the message just sent:</p>
<pre>RCVMSG MSGQ(MYLIB/MYMSGQ) MSG(&amp;MSG); DTACCSID(&amp;DTACCSID); +
CCSID(277) MSGDTA(&amp;MSGDTA); TXTCCSID(&amp;TXTCCSID);</pre>
<div class="note"><span class="notetitle">Note:</span> X'7B'
is the number sign (#) on code page 00037.</div>
<p>Because the message description
is tagged 65535, no conversion is performed when retrieving the message text
of TST0005. The replacement data is tagged 00037. The *CCHAR part of the message
data is converted from CCSID 00037 to CCSID 00277 before being inserted for &amp;2;
*CHAR data is never converted.</p>
<p>The following table shows the returned
values after the Receive Message command runs:</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" frame="border" border="1" rules="all"><thead align="left"><tr><th valign="top" id="d0e69">Value</th>
<th valign="top" id="d0e71">Description</th>
</tr>
</thead>
<tbody><tr><td valign="top" headers="d0e69 ">&amp;MSG =</td>
<td valign="top" headers="d0e71 "><p>This is &amp;CHAR <img src="la520000.gif" alt="AE ligature character" />. This is *CCHAR #.</p>
<p>The
*CHAR data was not converted when substituted for &amp;1; The *CHAR data remains
X'7B'. X'7B' is the code point on code page 00277 for A ligature (<img src="la520000.gif" alt="AE ligature character" />).</p>
<p>The *CCHAR data was
converted to X'4A' before it was substituted for &amp;2; X'4A' is the code
point on code page 00277 for the number sign (#).</p>
</td>
</tr>
<tr><td valign="top" headers="d0e69 ">&amp;TXTCCSID = 65535</td>
<td valign="top" headers="d0e71 ">The &amp;TXTCCSID variable was set to 65535 because no conversion occurred.
When no conversion occurs, the CCSID of the message description is returned
if the CCSID of the message file is 65534.</td>
</tr>
<tr><td valign="top" headers="d0e69 ">&amp;DTACCSID = 00277</td>
<td valign="top" headers="d0e71 ">The &amp;DTACCSID variable was set to 00277 because a conversion occurred.</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section"><h4 class="sectiontitle">Example 2: Receive a message with CCSID support</h4><p>Message
file MYMSGF has a CCSID of 00037. Message queue MYMSGQ has a CCSID of 65534.
The message being received has a message-level CCSID of 00277. CCSID 65534
uses the message-level CCSID when determining the CCSID the replacement data
is to be converted from.</p>
<p>The message being received is a stored message.
The stored message has *CCHAR replacement data. The CCSID of the job is 00278.
You enter the following Receive Message command:</p>
<pre>RCVMSG MSGQ(MYMSGQ) MSG(&amp;MSG); MSGDTA(&amp;MSGDTA);</pre>
<p>The
first-level text of the stored message that you receive is converted from
CCSID 00037 to CCSID 00278. The replacement data of the message that you receive
is converted from CCSID 00277 to CCSID 00278. Then the replacement data is
substituted into the first-level text and returned in &amp;MSG.</p>
<p>Both
the first-level text and the replacement data of the message that you received
are converted to the CCSID of the job because the CCSID of the job is the
default for the CCSID-to-convert-to parameter.</p>
<p>Two different conversions
must occur because only the replacement data is stored in the message queue
for stored messages. The text of a stored message must be retrieved from the
message file. If the message contained other replacement data type fields
that were not defined as *CCHAR, the non-*CCHAR data is not converted before
being returned.</p>
<div class="note"><span class="notetitle">Note:</span> If the CCSID of the message queue is 00278, no conversion
occurs on the replacement data before the message is returned, even though
the message CCSID is 00277. Remember that the message queue CCSID takes precedence
over the message-level CCSID.</div>
</div>
</div>
<div>
<ul class="ullinks">
<li class="ulchildlink"><strong><a href="rbagstxtccsidreturnfield.htm">CCSID of the message text returned (TXTCCSID) return field</a></strong><br />
TXTCCSID is the CCSID of the message text returned.</li>
<li class="ulchildlink"><strong><a href="rbagsdtaccsidreturnfield.htm">CCSID of the replacement data returned (DTACCSID) return field</a></strong><br />
DTACCSID is the CCSID of the replacement data returned.</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/rcvmsg.htm">Receive Message (RCVMSG) command</a></div>
<div><a href="../apis/Qmhrcvm.htm">Receive Nonprogram Message (QMHRCVM) API</a></div>
<div><a href="../apis/QMHRCVPM.htm">Receive Program Message (QMHRCVPM) API</a></div>
</div>
</div>
</body>
</html>