ibm-information-center/dist/eclipse/plugins/i5OS.ic.cl_5.4.0.1/rcvmsg.htm

1106 lines
53 KiB
HTML
Raw Permalink Normal View History

2024-04-02 14:02:31 +00:00
<!doctype html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head><META http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Receive Message (RCVMSG)</title>
<link rel="stylesheet" type="text/css" href="../rzahg/ic.css">
</head>
<body bgcolor="white">
<script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<a name="RCVMSG.Top_Of_Page"></a>
<h2>Receive Message (RCVMSG)</h2>
<table width="100%">
<tr>
<td valign="top" align="left"><b>Where allowed to run: </b>Compiled CL program or interpreted REXX (*BPGM *IPGM *BREXX *IREXX)<br>
<b>Threadsafe: </b>Yes
</td>
<td valign="top" align="right">
<a href="#RCVMSG.PARAMETERS.TABLE">Parameters</a><br>
<a href="#RCVMSG.COMMAND.EXAMPLES">Examples</a><br>
<a href="#RCVMSG.ERROR.MESSAGES">Error messages</a></td>
</tr>
</table>
<div> <a name="RCVMSG"></a>
<p>The Receive Message (RCVMSG) command is used by a program to receive a message previously sent to a message queue.
</p>
<p>The RCVMSG command receives messages from a job message queue (a message queue associated with a call stack entry or the external message queue (*EXT)), or from a named message queue. The program can receive a message from a message queue associated with its own call stack entry or from a message queue associated with another call stack entry.
</p>
<p>This command copies a message received in the specified message queue into control language (CL) variables within the program. The message and its attributes are copied into the CL variables specified by the parameters KEYVAR through DTACCSID.
</p>
<p>You can specify the message being received by indicating the message type, the reference key of the message, or both. The program receiving the message can also specify, on the RCVMSG command, whether a message is removed from the message queue or left there as an old message. If the specified message queue is not allocated to the job in which this command is entered, or to any other job, the message queue is implicitly allocated by this command for the duration of the command's processing.
</p>
<p>If a message of the specified type does not exist on the queue, the requesting program can either wait for a message to arrive or continue with other processing. This allows a set of message queues to be polled.
</p>
<p>If the message received is an unhandled exception message, the program can specify whether this command should handle the exception. An unhandled exception message is an escape, status, or notify message that has been sent to an Integrated Language Environment (ILE) procedure. When this command is run, the ILE procedure has not yet taken action to tell the system that the exception is handled. One action the ILE procedure can take is to call a CL program that receives the message using this command. More information on actions that can be taken is in the ILE Concepts book, SC41-5606.
</p>
</div>
<table width="100%">
<tr><td align="right"><a href="#RCVMSG.Top_Of_Page">Top</a></td></tr>
</table>
<hr size="2" width="100%">
<div>
<h3><a name="RCVMSG.PARAMETERS.TABLE">Parameters</a></h3>
<table border="1" cellpadding="4" cellspacing="0">
<!-- col1="10" col2="15" col3="30" col4="10" -->
<tr>
<th bgcolor="aqua" valign="bottom" align="left">Keyword</th>
<th bgcolor="aqua" valign="bottom" align="left">Description</th>
<th bgcolor="aqua" valign="bottom" align="left">Choices</th>
<th bgcolor="aqua" valign="bottom" align="left">Notes</th>
</tr>
<tr>
<td valign="top" rowspan="6"><a href="#RCVMSG.PGMQ"><b>PGMQ</b></a></td>
<td valign="top">Call stack entry message queue</td>
<td valign="top">Single values: *EXT<br>Other values: <i>Element list</i></td>
<td valign="top" rowspan="6">Optional, Positional 1</td>
</tr>
<tr>
<td valign="top">Element 1: Relationship</td>
<td valign="top">
<b><u>*SAME</u></b>, *PRV</td>
</tr>
<tr>
<td valign="top">Element 2: Call stack entry identifier</td>
<td valign="top">
<i>Element list</i></td>
</tr>
<tr>
<td valign="top" style="padding-left:10pt">Element 1: Call stack entry</td>
<td valign="top">
<i>Character value</i>, <b><u>*</u></b></td>
</tr>
<tr>
<td valign="top" style="padding-left:10pt">Element 2: Module</td>
<td valign="top">
<i>Name</i>, <b><u>*NONE</u></b></td>
</tr>
<tr>
<td valign="top" style="padding-left:10pt">Element 3: Bound program</td>
<td valign="top">
<i>Name</i>, <b><u>*NONE</u></b></td>
</tr>
<tr>
<td valign="top" rowspan="3"><a href="#RCVMSG.MSGQ"><b>MSGQ</b></a></td>
<td valign="top">Message queue</td>
<td valign="top">Single values: *PGMQ<br>Other values: <i>Qualified object name</i></td>
<td valign="top" rowspan="3">Optional, Positional 2</td>
</tr>
<tr>
<td valign="top">Qualifier 1: Message queue</td>
<td valign="top"><i>Name</i></td>
</tr><tr>
<td valign="top">Qualifier 2: Library</td>
<td valign="top"><i>Name</i>, <b><u>*LIBL</u></b>, *CURLIB</td>
</tr><tr>
<td valign="top"><a href="#RCVMSG.MSGTYPE"><b>MSGTYPE</b></a></td>
<td valign="top">Message type</td>
<td valign="top"><b><u>*ANY</u></b>, *NEXT, *PRV, *INFO, *INQ, *RPY, *FIRST, *COPY, *COMP, *DIAG, *EXCP, *RQS, *LAST</td>
<td valign="top">Optional, Positional 3</td>
</tr>
<tr>
<td valign="top"><a href="#RCVMSG.MSGKEY"><b>MSGKEY</b></a></td>
<td valign="top">Message key</td>
<td valign="top"><i>Character value</i>, <b><u>*NONE</u></b>, *TOP</td>
<td valign="top">Optional, Positional 4</td>
</tr>
<tr>
<td valign="top"><a href="#RCVMSG.WAIT"><b>WAIT</b></a></td>
<td valign="top">Wait time</td>
<td valign="top"><i>Integer</i>, <b><u>0</u></b>, *MAX</td>
<td valign="top">Optional, Positional 5</td>
</tr>
<tr>
<td valign="top"><a href="#RCVMSG.RMV"><b>RMV</b></a></td>
<td valign="top">Remove message</td>
<td valign="top"><b><u>*YES</u></b>, *NO, *KEEPEXCP</td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top"><a href="#RCVMSG.CCSID"><b>CCSID</b></a></td>
<td valign="top">Coded character set ID</td>
<td valign="top">1-65535, *HEX, <b><u>*JOB</u></b></td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top"><a href="#RCVMSG.RJTDFTRPY"><b>RJTDFTRPY</b></a></td>
<td valign="top">Reject default reply</td>
<td valign="top"><b><u>*NOALWRJT</u></b>, *ALWRJT</td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top"><a href="#RCVMSG.KEYVAR"><b>KEYVAR</b></a></td>
<td valign="top">CL var for KEYVAR (4)</td>
<td valign="top"><i>Character value</i></td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top"><a href="#RCVMSG.MSG"><b>MSG</b></a></td>
<td valign="top">CL var for 1st level text</td>
<td valign="top"><i>Character value</i></td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top"><a href="#RCVMSG.MSGLEN"><b>MSGLEN</b></a></td>
<td valign="top">CL var for MSGLEN (5 0)</td>
<td valign="top"><i>Decimal number</i></td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top"><a href="#RCVMSG.SECLVL"><b>SECLVL</b></a></td>
<td valign="top">CL var for 2nd level text</td>
<td valign="top"><i>Character value</i></td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top"><a href="#RCVMSG.SECLVLLEN"><b>SECLVLLEN</b></a></td>
<td valign="top">CL var for SECLVLLEN (5 0)</td>
<td valign="top"><i>Decimal number</i></td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top"><a href="#RCVMSG.MSGDTA"><b>MSGDTA</b></a></td>
<td valign="top">CL var for msg data</td>
<td valign="top"><i>Not restricted</i></td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top"><a href="#RCVMSG.MSGDTALEN"><b>MSGDTALEN</b></a></td>
<td valign="top">CL var for MSGDTALEN (5 0)</td>
<td valign="top"><i>Decimal number</i></td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top"><a href="#RCVMSG.MSGID"><b>MSGID</b></a></td>
<td valign="top">CL var for MSGID (7)</td>
<td valign="top"><i>Character value</i></td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top"><a href="#RCVMSG.SEV"><b>SEV</b></a></td>
<td valign="top">CL var for SEV (2 0)</td>
<td valign="top"><i>Decimal number</i></td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top"><a href="#RCVMSG.SENDER"><b>SENDER</b></a></td>
<td valign="top">CL var for SENDER (80)</td>
<td valign="top"><i>Character value</i></td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top"><a href="#RCVMSG.SENDERFMT"><b>SENDERFMT</b></a></td>
<td valign="top">Sender format</td>
<td valign="top"><b><u>*SHORT</u></b>, *LONG</td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top"><a href="#RCVMSG.RTNTYPE"><b>RTNTYPE</b></a></td>
<td valign="top">CL var for RTNTYPE (2)</td>
<td valign="top"><i>Character value</i></td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top"><a href="#RCVMSG.ALROPT"><b>ALROPT</b></a></td>
<td valign="top">CL var for ALROPT (9)</td>
<td valign="top"><i>Character value</i></td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top"><a href="#RCVMSG.MSGF"><b>MSGF</b></a></td>
<td valign="top">CL var for MSGF (10)</td>
<td valign="top"><i>Character value</i></td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top"><a href="#RCVMSG.MSGFLIB"><b>MSGFLIB</b></a></td>
<td valign="top">CL var for MSGFLIB (10)</td>
<td valign="top"><i>Character value</i></td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top"><a href="#RCVMSG.SNDMSGFLIB"><b>SNDMSGFLIB</b></a></td>
<td valign="top">CL var for SNDMSGFLIB (10)</td>
<td valign="top"><i>Character value</i></td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top"><a href="#RCVMSG.TXTCCSID"><b>TXTCCSID</b></a></td>
<td valign="top">CL var for text CCSID (5 0)</td>
<td valign="top"><i>Decimal number</i></td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top"><a href="#RCVMSG.DTACCSID"><b>DTACCSID</b></a></td>
<td valign="top">CL var for data CCSID (5 0)</td>
<td valign="top"><i>Decimal number</i></td>
<td valign="top">Optional</td>
</tr>
</table>
<table width="100%">
<tr><td align="right"><a href="#RCVMSG.Top_Of_Page">Top</a></td></tr>
</table>
</div>
<div> <a name="RCVMSG.PGMQ"></a>
<h3>Call stack entry message queue (PGMQ)</h3>
<p>Specifies the call stack entry message queue from which a message is received. The call stack entry message queue can be the *EXT queue or it can be a message queue that is associated with a call stack entry for a program or an ILE procedure.
</p>
<p>If values are specified for this parameter, specifying *PGMQ for the <b>Message queue (MSGQ)</b> parameter is allowed.
</p>
<p><b>Single values</b>
</p>
<dl>
<dt><b>*EXT</b></dt>
<dd>The message is received from the external message queue of the job. The external message queue is used to communicate with the external requester of the job, such as a display station user.
</dd>
</dl>
<p><b>Element 1: Relationship</b>
</p>
<p>Element 1 of this parameter specifies whether the message queue is associated with the program or procedure identified by Element 2, or if it is associated with the caller of the program or procedure.
</p>
<dl>
<dt><b><u>*SAME</u></b></dt>
<dd>The message is received from the message queue of the program or procedure identified by element 2.
</dd>
<dt><b>*PRV</b></dt>
<dd>The message is received from the message queue of the program or procedure that called the program or procedure identified by element 2 of this parameter.
<p>
<b>Note: </b>If the message queue previous to the one identified by element 2 is for an ILE program entry procedure (PEP), the message will be received from the message queue immediately previous to the PEP message queue; effectively this would be <i>two</i> message queues previous to the one identified by element 2.
</p>
</dd>
</dl>
<p><b>Element 2: Call stack entry identifier</b>
</p>
<p>The second element of this parameter has three elements. Element 1 specifies an OPM program or ILE procedure name or a special value. Element 2 specifies an ILE module name which is used as a qualifier for the value specified in element 1. Element 3 can specify either an OPM program name or an ILE program name or a service program name, depending on what is specified in element 1. Element 3 is also used as a qualifier for what is specified in element 1.
</p>
<dl>
<dt><b></b></dt>
<dd>
<p><b>Element 1: Call stack entry</b>
</p>
<dl>
<dt><b><u>*</u></b></dt>
<dd>Specifies the OPM program or ILE procedure running this command.
</dd>
<dt><b><i>name</i></b></dt>
<dd>Specify the name of the OPM program or ILE procedure used to identify the call stack entry.
<p>If this element identifies an OPM program, the name specified can be a maximum of 10 characters. If this element identifies an ILE procedure, the name specified can be a maximum of 256 characters.
</p>
<p>Nested procedure names can be specified by separating each procedure name with a colon (:). When specifying nested procedure names, the outermost procedure name is identified first, followed by its contained procedures. The innermost procedure name is identified last in the string.
</p>
<p>Partial names of programs or procedures can be specified by placing three less-than symbols (&lt;&lt;&lt;) at the beginning of the name or by placing three greater-than symbols (&gt;&gt;&gt;) at the end of the name. If both the greater-than symbols and the less-than symbols are used, the program or procedure name specified is limited to 250 characters.
</p>
<p>The system begins its search for the specified program or procedure name with the most recently called program or procedure.
</p>
<p>When searching for a partial program or procedure name:
</p>
<ul>
<li>The less-than symbols (&lt;&lt;&lt;) are truncated when specified only at the beginning of a program or procedure name and the remaining character string is right-justified. The remaining characters in the specified string are compared to the current program or procedure on the call stack, starting with the last position of the program or procedure name and comparing backward.
</li>
<li>The greater-than symbols (&gt;&gt;&gt;) are truncated when specified only at the end of a program or procedure name. The remaining characters in the specified string are compared to the current program or procedure on the call stack, starting with the first position of the program or procedure name.
</li>
<li>The less-than symbols (&lt;&lt;&lt;) and the greater-than symbols (&gt;&gt;&gt;) are truncated when both are specified for a program or procedure name. The remaining characters are used to scan and compare the entire length of the specified string with the current program or procedure on the call stack.
</li>
</ul>
</dd>
</dl>
</dd>
<dt><b></b></dt>
<dd>
<p><b>Element 2: Module</b>
</p>
<dl>
<dt><b><u>*NONE</u></b></dt>
<dd>No ILE module qualifier is provided.
</dd>
<dt><b><i>name</i></b></dt>
<dd>Specify the ILE module name to be used to identify the message queue.
</dd>
</dl>
</dd>
<dt><b></b></dt>
<dd>
<p><b>Element 3: Program</b>
</p>
<dl>
<dt><b><u>*NONE</u></b></dt>
<dd>No program qualifier is provided.
</dd>
<dt><b><i>name</i></b></dt>
<dd>Specify the program name to be used to identify the message queue.
</dd>
</dl>
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#RCVMSG.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="RCVMSG.MSGQ"></a>
<h3>Message queue (MSGQ)</h3>
<p>Specifies the message queue (not a program message queue) from which a message is to be received.
</p>
<p><b>Single values</b>
</p>
<dl>
<dt><b>*PGMQ</b></dt>
<dd>The program message queue specified for the <b>Call stack entry message queue (PGMQ)</b> parameter is the only queue from which a message is received.
</dd>
</dl>
<p><b>Qualifier 1: Message queue</b>
</p>
<dl>
<dt><b><i>name</i></b></dt>
<dd>Specify the name of the message queue from which a message is to be received. If a message queue name is specified, the <b>Call stack entry message queue (PGMQ)</b> parameter cannot be specified.
</dd>
</dl>
<p><b>Qualifier 2: Library</b>
</p>
<dl>
<dt><b><u>*LIBL</u></b></dt>
<dd>All libraries in the library list for the current thread are searched until the first match is found.
</dd>
</dl>
<dl>
<dt><b>*CURLIB</b></dt>
<dd>The current library for the job is used to locate the message queue. If no library is specified as the current library for the job, QGPL is used.
</dd>
<dt><b><i>name</i></b></dt>
<dd>Specify the library where the message queue is located.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#RCVMSG.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="RCVMSG.MSGTYPE"></a>
<h3>Message type (MSGTYPE)</h3>
<p>Specifies the type of message received by this program.
</p>
<dl>
<dt><b><u>*ANY</u></b></dt>
<dd>Any type of message (except a sender's copy) is received. To receive a sender's message, MSGTYPE(*COPY) must be specified.
</dd>
<dt><b>*NEXT</b></dt>
<dd>The message that follows the one specified for the <b>Message key (MSGKEY)</b> parameter is received. If there is not another message available, blanks are returned in all CL variables.
<p>When a message is received from a message queue associated with a call stack entry, *NEXT works only for one call stack entry. *NEXT cannot be used to receive messages for multiple call stack entries of the same program.
</p>
</dd>
<dt><b>*PRV</b></dt>
<dd>The message previous to the message specified for the <b>Message key (MSGKEY)</b> parameter is received.
</dd>
<dt><b>*INFO</b></dt>
<dd>An informational message is received.
</dd>
<dt><b>*INQ</b></dt>
<dd>An inquiry message is received.
</dd>
<dt><b>*RPY</b></dt>
<dd>A reply message is received. This program has sent an inquiry message to a message queue and expects a reply.
</dd>
<dt><b>*FIRST</b></dt>
<dd>The first message currently on the message queue or program queue is received.
</dd>
<dt><b>*COPY</b></dt>
<dd>A copy of an inquiry message that was previously sent is received by this program. The message queue specified for the <b>Call stack entry message queue (PGMQ)</b> parameter or the <b>Message queue (MSGQ)</b> parameter must be the same queue that was specified for the <b>Message queue to get reply (RPYMSGQ)</b> parameter when the INQ message was sent.
</dd>
<dt><b>*COMP</b></dt>
<dd>A completion message is received. This type of message can only be received from a program message queue.
</dd>
<dt><b>*DIAG</b></dt>
<dd>A diagnostic message is received. This type of message can only be received from a program message queue.
</dd>
<dt><b>*EXCP</b></dt>
<dd>An exception message is received. Exception messages (escape, notify, status) are received by the program in last-in first-out (LIFO) order. The receiving program can monitor for exception messages by using the MONMSG command.
<p>
<b>Note: </b>Non-exception messages are received in first-in first-out (FIFO) order.
</p>
<p>If an exception message is received from a message queue for a procedure, the related exception may not be handled at the time the RCVMSG command is run. The RMV parameter can be used to specify whether the exception is to be handled by the RCVMSG command.
</p>
</dd>
<dt><b>*RQS</b></dt>
<dd>A request message is received. This type of message can only be received from a program message queue.
</dd>
<dt><b>*LAST</b></dt>
<dd>The last message currently on the message queue or program queue is received.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#RCVMSG.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="RCVMSG.MSGKEY"></a>
<h3>Message key (MSGKEY)</h3>
<p>Specifies the message reference key of the message that is received.
</p>
<dl>
<dt><b><u>*NONE</u></b></dt>
<dd>No message reference key is specified.
</dd>
<dt><b>*TOP</b></dt>
<dd>The top of the message queue is used. *TOP can be used only when *NEXT is specified for the <b>Message type (MSGTYPE)</b> parameter. It causes the first message on the message queue to be received. For program message queues, this is the message following the last request message that was received, if any.
</dd>
<dt><b><i>name</i></b></dt>
<dd>Specify the name of the CL variable that contains the message reference key of the message to be used by this receive function. The variable must be a character variable having a length of 4 characters.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#RCVMSG.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="RCVMSG.WAIT"></a>
<h3>Wait time (WAIT)</h3>
<p>Specifies, in seconds, the length of time that the program waits for a message of the specified type to arrive in the message queue if it is not there when this command is processed. If the message does not arrive in the specified time, the control language (CL) variables named to receive message fields are filled with blanks (or zeros, if they are decimal variables).
</p>
<p>The program cannot wait for a message from a program message queue unless it is receiving a reply.
</p>
<p>If a wait time is specified (not zero), the message queue is implicitly allocated to the first user whose message is received, and it is not released until the request has been handled by the program.
</p>
<p>If a message is sent to a message queue in the same job, and the message queue is in break delivery mode, this parameter is ignored (that implies WAIT(0), which is the default value for the WAIT parameter).
</p>
<p>If the value specified for MSGKEY refers to an inquiry message, and MSGTYPE(*RPY) has been specified, the program ignores the WAIT parameter (value for Wait is 0).
</p>
<dl>
<dt><b><u>0</u></b></dt>
<dd>The program does not wait for the arrival of a message.
</dd>
<dt><b>*MAX</b></dt>
<dd>The program waits indefinitely for the arrival of the specified message.
</dd>
<dt><b><i>number-of-seconds</i></b></dt>
<dd>Specifies the number of seconds that the program waits for the arrival of a message.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#RCVMSG.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="RCVMSG.RMV"></a>
<h3>Remove message (RMV)</h3>
<p>Specifies whether the message received by the program is removed from the message queue. For messages that are unhandled exceptions, this parameter also specifies whether the exception is to be handled. If *INQ is specified for the <b>Message type (MSGTYPE)</b> parameter, then *NO must also be specified for this parameter so a reply to the inquiry message can be sent, otherwise the default reply will be sent before the unanswered inquiry is removed.
</p>
<dl>
<dt><b><u>*YES</u></b></dt>
<dd>The message is removed from the message queue. If the message is an unhandled exception, the exception is handled by running the RCVMSG command.
</dd>
<dt><b>*NO</b></dt>
<dd>The message is not removed from the message queue. It is left on the message queue as an old message. If the message is an unhandled exception, the exception is handled by running the RCVMSG command.
<p><b>Note:</b> Old messages are messages that have been received but not deleted. An old message can be received again in one of the following ways:
</p>
<ol>
<li>The message reference key of the message is specified for the MSGKEY parameter.
</li>
<li>A message type of *FIRST, *LAST, *NEXT, or *PRV is specified for the <b>Message type (MSGTYPE)</b> parameter.
</li>
</ol>
</dd>
<dt><b>*KEEPEXCP</b></dt>
<dd>If the message is an exception message and the exception has not been handled, the exception is left unhandled and the message is left on the message queue as a new message. It can be received again by using the RCVMSG command to receive an *EXCP message. If the message is not an exception message, or if it is but the exception has already been handled, the message is left on the message queue as an old message.
<p>To handle an exception after the RCVMSG has been run, the command can be run a second time by specifying RMV(*YES) or RMV(*NO).
</p>
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#RCVMSG.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="RCVMSG.CCSID"></a>
<h3>Coded character set ID (CCSID)</h3>
<p>Specifies the coded character set identifier (CCSID) that you want the message text returned in. This only applies to text returned in the MSG, SECLVL and MSGDTA parameters. When replacement data is returned in the MSGDTA parameter or substituted into the text returned in the MSG or SECLVL parameters, only the part of the replacement text that is defined as a character that can be converted (*CCHAR) is converted. The rest of the replacement data is not converted. For more information about the *CCHAR field, see the ADDMSGD command.
</p>
<dl>
<dt><b><u>*JOB</u></b></dt>
<dd>The received message is converted to the CCSID of the job before being returned.
</dd>
<dt><b>*HEX</b></dt>
<dd>The received message is not converted before being returned.
</dd>
<dt><b><i>coded-character-set-identifier</i></b></dt>
<dd>Specify the CCSID that you want your message converted to before being returned. Valid values range from 1 through 65535. See the Globalization information in the iSeries Information Center at http://www.ibm.com/eserver/iseries/infocenter for a list of valid values. Only CCSID values that a job can be changed to are accepted.
<p>For more information on the message handler and its use of CCSIDs, see the Globalization topic in the iSeries Information Center at http://www.ibm.com/eserver/iseries/infocenter.
</p>
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#RCVMSG.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="RCVMSG.RJTDFTRPY"></a>
<h3>Reject default reply (RJTDFTRPY)</h3>
<p>Removing an unanswered inquiry message causes the default reply to be sent to the inquiry message. This value indicates whether a reply handling exit program will be allowed to reject a default reply that is sent as a result of using this command. A reply handling exit program can be registered via the system registration facility for exit point QIBM_QMH_REPLY_INQ. This parameter is only applicable when *YES is specified for the RMV keyword.
</p>
<dl>
<dt><b><u>*NOALWRJT</u></b></dt>
<dd>A reply handling exit program will not be allowed to reject a default reply.
</dd>
<dt><b>*ALWRJT</b></dt>
<dd>A reply handling exit program will be allowed to reject a default reply. If an exit program rejects the reply, message CPD2476 (Reply rejected by a reply handling exit program) will be sent as a diagnostic message to the program using this command. The CPD2476 will be followed by a CPF2422 (Reply not valid) escape message that the program using this command should monitor for to handle and recover from error situations.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#RCVMSG.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="RCVMSG.KEYVAR"></a>
<h3>CL var for KEYVAR (4) (KEYVAR)</h3>
<p>Specifies the name of the control language (CL) character variable, if any, that contains the message reference key identifying the message received by the program containing this command. At the time the RCVMSG command is processed, the system returns the message reference key to the variable specified by KEYVAR in this command and changes the received message to an old message. The message reference key can then be used in the MSGKEY parameter in a subsequent RCVMSG command to receive the old message. If the message is not found, blanks are returned for the KEYVAR variable. For reply type messages, use the MSGKEY parameter on this command in conjunction with the KEYVAR parameter on the SNDPGMMSG command. The message reference key can also be used by this program for building message subfiles. The CL variable is the name of the field for which the SFLMSGKEY keyword is specified in the DDS for the message subfile.
</p>
<p>
<b>Note: </b>For message queues not associated with call stack entries, message reference keys can be used again after a message has been received and then removed (by specifying *YES for the RMV parameter).
</p>
<p>The variable must be a character variable having a length of 4 characters.
</p>
<p>
<b>Note: </b>When using the message reference key (obtained from the CL variable specified by the KEYVAR parameter of the Send Program Message (SNDPGMMSG) command) to receive the reply to an inquiry message, note that the message reference key refers to the sender's copy. The sender's copy message is located on the reply message queue (which defaults to the program message queue that sent the inquiry message), not the message queue to which the inquiry message was sent.
</p>
</div>
<table width="100%">
<tr><td align="right"><a href="#RCVMSG.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="RCVMSG.MSG"></a>
<h3>CL var for 1st level text (MSG)</h3>
<p>Specifies the name of the control language (CL) character variable, if any, that contains the message when it is received by the program. This includes the message data fields that were substituted for substitution variables in the text before the message was sent (replies and immediate messages contain no message data fields). This is a variable-length field, but most message text is less than 132 characters in length.
</p>
</div>
<table width="100%">
<tr><td align="right"><a href="#RCVMSG.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="RCVMSG.MSGLEN"></a>
<h3>CL var for MSGLEN (5 0) (MSGLEN)</h3>
<p>Specifies the name of the control language (CL) decimal variable, if any, that contains the total length of the message text available to be received. The variable must be a decimal variable having a length of 5 positions.
</p>
</div>
<table width="100%">
<tr><td align="right"><a href="#RCVMSG.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="RCVMSG.SECLVL"></a>
<h3>CL var for 2nd level text (SECLVL)</h3>
<p>Specifies the name of the CL character variable, if any, that contains the message help received by the program. This includes the message data fields that were substituted for any substitution variables in the text before the message was sent (replies and immediate messages do not have second-level messages). This is a variable-length field, but most online message help is designed to be less than 3000 characters in length.
</p>
</div>
<table width="100%">
<tr><td align="right"><a href="#RCVMSG.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="RCVMSG.SECLVLLEN"></a>
<h3>CL var for SECLVLLEN (5 0) (SECLVLLEN)</h3>
<p>Specifies the name of the control language (CL) decimal variable, if any, that contains the total length of the message help available to be received. The variable must be a decimal variable having a length of 5 positions.
</p>
</div>
<table width="100%">
<tr><td align="right"><a href="#RCVMSG.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="RCVMSG.MSGDTA"></a>
<h3>CL var for msg data (MSGDTA)</h3>
<p>Specifies the name of the control language (CL) character variable, if any, that contains the message data record received by the program as part of the message. The message data record contains the substitution values (in a single character string) that are used in the text of the received message. The amount of data returned and its format depend on the message. Pointers contained in system messages are invalidated.
</p>
<p>
<b>Note: </b>If you use data that has an invalidated pointer in it an error message can occur.
</p>
</div>
<table width="100%">
<tr><td align="right"><a href="#RCVMSG.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="RCVMSG.MSGDTALEN"></a>
<h3>CL var for MSGDTALEN (5 0) (MSGDTALEN)</h3>
<p>Specifies the name of the control language (CL) decimal variable, if any, that contains the total length of the message data record available to be received. The variable must be a decimal variable having a length of 5 positions.
</p>
</div>
<table width="100%">
<tr><td align="right"><a href="#RCVMSG.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="RCVMSG.MSGID"></a>
<h3>CL var for MSGID (7) (MSGID)</h3>
<p>Specifies the name of the control language (CL) character variable, if any, that contains the message identifier of the message received by the program. If the message being received is an immediate message, the message identifier is returned as blanks. The minimum length of the variable is 7 characters.
</p>
</div>
<table width="100%">
<tr><td align="right"><a href="#RCVMSG.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="RCVMSG.SEV"></a>
<h3>CL var for SEV (2 0) (SEV)</h3>
<p>Specifies the name of the control language (CL) decimal variable, if any, that contains the severity code of the message received by the program. If the message being received is an immediate message, the message severity is not returned. The variable must be a decimal variable having a length of 2 positions.
</p>
</div>
<table width="100%">
<tr><td align="right"><a href="#RCVMSG.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="RCVMSG.SENDER"></a>
<h3>CL var for SENDER (80) (SENDER)</h3>
<p>Specifies the name of the control language (CL) character variable, if any, that contains the identification of the sender of the message received through the RCVMSG command. The length of the CL variable depends on the SENDERFMT specification. If SENDERFMT(*SHORT) is specified, the variable must be a minimum of 80 characters. If the CL variable is longer than 80 characters, additional information will be returned. If SENDERFMT(*LONG) is specified, the variable must be a minimum of 720 characters.
</p>
</div>
<table width="100%">
<tr><td align="right"><a href="#RCVMSG.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="RCVMSG.SENDERFMT"></a>
<h3>Sender format (SENDERFMT)</h3>
<p>Specifies which format of the sender identification is returned. This parameter is valid only when the SENDER parameter is specified.
</p>
<dl>
<dt><b><u>*SHORT</u></b></dt>
<dd>The short format of the sender information is returned. The short format is a minimum of 80 characters, If the CL variable is longer than 80 characters, additional information will be returned. Positions in the CL variable beyond the last returned field will be set to blanks. The following information is returned:
<ul>
<li>The first 26 characters identify the sending job
<ul>
<li>Job name (10)
</li>
<li>User name (10)
</li>
<li>Job number (6)
</li>
</ul>
</li>
<li>The next 16 characters identify the sending program
<ul>
<li>Program name (12) (for an ILE procedure, this is the bound program name); if the sender type is 3, the first three characters of this field are less than symbols (&lt;&lt;&lt;) followed by the last nine characters of the program name
</li>
<li>Instruction number (4) (for an ILE procedure, this field is set to blanks)
</li>
</ul>
</li>
<li>The next 13 characters are the date and time
<ul>
<li>Date (7) (in the format 0yymmdd)
</li>
<li>Time (6) (in the format hhmmss)
</li>
</ul>
</li>
<li>The next 14 characters identify the sent-to call stack entry if the message is sent to a program message queue
<ul>
<li>Program name (10) (for an ILE procedure, this is the bound program name)
</li>
<li>Instruction number (4) (for an ILE procedure, this field is set to blanks)
</li>
</ul>
</li>
<li>The next 1 character identifies the sender type
<ul>
<li>"0" if the sender is an OPM program or a SLIC program with 12 characters or less
</li>
<li>"1" if the sender is an ILE procedure and the name is 256 characters or less
</li>
<li>"2" if the sender is an ILE procedure and the name is more than 256 characters
</li>
<li>"3" if the sender is a SLIC program with more than 12 characters
</li>
</ul>
</li>
<li>The next 1 character identifies the sent-to type
<ul>
<li>"0" if the receiver is an OPM program
</li>
<li>"1" if the receiver is an ILE procedure and the name is 256 characters or less
</li>
<li>"2" if the receiver is an ILE procedure and the name is more than 256 characters
</li>
</ul>
</li>
<li>The next 6 characters are the microseconds
</li>
<li>The last 10 characters are the name of the user profile that the thread was running under when the message was sent, and is returned if the length of the CL variable is at least 87
</li>
</ul>
</dd>
<dt><b>*LONG</b></dt>
<dd>The long format of the sender information is returned. The long format is 720 characters, with the last 30 characters set to blanks. The following information is returned:
<ul>
<li>The first 26 characters identify the sending job
<ul>
<li>Job name (10)
</li>
<li>User name (10)
</li>
<li>Job number (6)
</li>
</ul>
</li>
<li>The next 13 characters are the date and time
<ul>
<li>Date (7) (in the format 0yymmdd)
</li>
<li>Time (6) (in the format hhmmss)
</li>
</ul>
</li>
<li>The next 1 character identifies the sender type
<ul>
<li>"0" if the sender is an OPM program or a SLIC program with 12 characters or less
</li>
<li>"1" if the sender is an ILE procedure and the name is 256 characters or less
</li>
<li>"2" if the sender is an ILE procedure and the name is more than 256 characters
</li>
<li>"3" if the sender is a SLIC program with more than 12 characters
</li>
</ul>
</li>
<li>The next 1 character identifies the sent-to type
<ul>
<li>"0" if the receiver is an OPM program
</li>
<li>"1" if the receiver is an ILE procedure and the name is 256 characters or less
</li>
<li>"2" if the receiver is an ILE procedure and the name is more than 256 characters
</li>
</ul>
</li>
<li>The next 12 characters are the sender's program name (for an ILE procedure, this is the bound program name); if the sender type is 3 and the program name is greater than 12 characters in length, the first three characters of this field are less than symbols (&lt;&lt;&lt;) followed by the last nine characters of the program name
</li>
<li>The next 10 characters are the sender's module name (if the sender is not an ILE procedure, this field is set to blanks)
</li>
<li>The next 256 characters are the sender's procedure name (if the sender is not an ILE procedure, this field is set to blanks)
<ul>
<li>For a nested procedure name, each procedure name is separated by a colon (:) starting with the outer-most procedure name, and ending with the inner-most procedure name
</li>
<li>For a procedure name that is longer than 256 characters, three less than symbols (&lt;&lt;&lt;) are returned followed by the last 253 characters of the procedure name; the QMHRCVPM API can be used to obtain the entire procedure name
</li>
</ul>
</li>
<li>The next 1 character is blank
</li>
<li>The next 4 characters are the number of statement numbers available
</li>
</ul>
<p>
<b>Note: </b>A statement number represents a point in the sending program at which the message was sent. For programs and non-optimized procedures, this count is always 1. For optimized procedures, this count can be greater than 1, and each statement number represents a point at which the message could have been sent. If it is not possible to return statement numbers, this count will be 0.
</p>
<ul>
<li>The next 30 characters return a maximum of 3 statement numbers, 10 characters each
</li>
<li>The next 320 characters return program or procedure information if the message being received was originally sent to a message queue associated with a call stack entry (otherwise, this field is set to blanks)
<ul>
<li>Sent-to program name (10) (for an ILE procedure, this is the bound program name)
</li>
<li>Sent-to module name (10) (if the sender is not an ILE procedure, this field is set to blanks)
</li>
<li>Sent-to procedure name (256) (if the sender is not an ILE procedure, this field is set to all blanks)
<ul>
<li>For a nested procedure name, each procedure name is separated by a colon (:) starting with the outer-most procedure name, and ending with the inner-most procedure name.
</li>
<li>For a procedure name that is longer than 256 characters, three less than symbols (&lt;&lt;&lt;) are returned followed by the last 253 characters of the procedure name; the QMHRCVPM API can be used to obtain the entire procedure name
</li>
</ul>
</li>
<li>Blanks (10)
</li>
<li>Number of statements available for the receiving call stack entry (4)
<p>
<b>Note: </b>A statement number represents a point at which the sent-to program was suspended (for example, due to a call operation) at the time the message was sent. For programs and non-optimized procedures, this count is always 1. For optimized procedures, this count can be greater than 1, and each statement number represents a point at which the message could have been sent. If it is not possible to return statement numbers, this count will be 0.
</p>
</li>
</ul>
</li>
</ul>
<ul>
<ul>
<li>Statement numbers (30) (a maximum of 3 statement numbers, 10 characters each)
</li>
</ul>
<li>The next 6 characters are the microseconds
</li>
<li>The last 10 characters are the name of the user profile that the thread was running under when the message was sent
</li>
</ul>
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#RCVMSG.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="RCVMSG.RTNTYPE"></a>
<h3>CL var for RTNTYPE (2) (RTNTYPE)</h3>
<p>Specifies the name of the control language (CL) variable, if any, that contains the type code for the message received by the program. The variable must be a character variable having a length of 2 positions.
</p>
<p>The following values are returned to indicate the message type:
</p>
<dl>
<dt><b>Value</b></dt>
<dd><b> Message Type
</b></dd>
<dt><b>01</b></dt>
<dd>Completion
</dd>
<dt><b>02</b></dt>
<dd>Diagnostic
</dd>
<dt><b>04</b></dt>
<dd>Information
</dd>
<dt><b>05</b></dt>
<dd>Inquiry
</dd>
<dt><b>06</b></dt>
<dd>Copy
</dd>
<dt><b>08</b></dt>
<dd>Request
</dd>
<dt><b>10</b></dt>
<dd>Request with prompting
</dd>
<dt><b>14</b></dt>
<dd>Notify (exception already handled at time of RCVMSG)
</dd>
<dt><b>15</b></dt>
<dd>Escape (exception already handled at time of RCVMSG)
</dd>
<dt><b>16</b></dt>
<dd>Notify (exception not handled at time of RCVMSG)
</dd>
<dt><b>17</b></dt>
<dd>Escape (exception not handled at time of RCVMSG)
</dd>
<dt><b>21</b></dt>
<dd>Reply, not checked for validity
</dd>
<dt><b>22</b></dt>
<dd>Reply, already checked for validity
</dd>
<dt><b>23</b></dt>
<dd>Reply, message default used
</dd>
<dt><b>24</b></dt>
<dd>Reply, system default used
</dd>
<dt><b>25</b></dt>
<dd>Reply, from System Reply List
</dd>
<dt><b>26</b></dt>
<dd>Reply, from exit program
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#RCVMSG.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="RCVMSG.ALROPT"></a>
<h3>CL var for ALROPT (9) (ALROPT)</h3>
<p>Specifies the name of the control language (CL) variable, if any, used to return the alert option of the message received by the program. The variable must be a character variable 9 positions in length.
</p>
</div>
<table width="100%">
<tr><td align="right"><a href="#RCVMSG.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="RCVMSG.MSGF"></a>
<h3>CL var for MSGF (10) (MSGF)</h3>
<p>Specifies the name of the control language (CL) variable, if any, used to return the message file name of the message received by the program. If the message received is a stored message, the message file name of the file containing the stored message is returned. If the received message is not a stored message, the message file name is returned as blanks. The variable must be a character variable 10 positions in length.
</p>
<p>
<b>Note: </b>The message file name returned on this parameter is the message file specified or defaulted on the send function, not the overriding message file. If an override was specified when sending the message, the same override should be used when receiving the message.
</p>
</div>
<table width="100%">
<tr><td align="right"><a href="#RCVMSG.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="RCVMSG.MSGFLIB"></a>
<h3>CL var for MSGFLIB (10) (MSGFLIB)</h3>
<p>Specifies the name of the control language (CL) variable, if any, used to return the message file library name of the message received by the program. If the message received is a stored message, the message file library name of the library containing the message file of the stored message is returned. If *LIBL was specified on the send command, *LIBL is returned. If the received message is not a stored message, the message file library name is returned as blanks. The variable must be a character variable 10 positions in length.
</p>
<p>
<b>Note: </b>The message file library name returned on this parameter is the message file specified or defaulted on the send function, not the overriding message file library. If an override was specified when sending the message, the same override should be used when receiving the message.
</p>
</div>
<table width="100%">
<tr><td align="right"><a href="#RCVMSG.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="RCVMSG.SNDMSGFLIB"></a>
<h3>CL var for SNDMSGFLIB (10) (SNDMSGFLIB)</h3>
<p>Specifies the name of the control language (CL) variable, if any, used to return the message file library name used to send the message. If the message received is a stored message, the message file library name of the library containing the message file of the stored message is returned. If *LIBL was specified on the send command, this parameter would have the actual name of the library. If the received message is not a stored message, the message file library name is returned as blanks. If the received message is a stored message and the original message file is destroyed, the message file library name is returned as blanks. If the received message is not a stored message, this parameter is returned as blanks. The variable must be a character variable of 10 positions in length.
</p>
</div>
<table width="100%">
<tr><td align="right"><a href="#RCVMSG.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="RCVMSG.TXTCCSID"></a>
<h3>CL var for text CCSID (5 0) (TXTCCSID)</h3>
<p>Specifies the name of the CL variable, if any, used to return the coded character set identifier (CCSID) associated with the text returned by the MSG and SECLVL parameters. If a conversion error occurs or if the CCSID you requested the text to be converted to is 65535, the CCSID that the message description or the text for an immediate message is stored in is returned. Otherwise, the CCSID you wanted the text converted to is returned. If you do not want the text converted before it is returned to you but you do want to know the CCSID that the message description or the text for an immediate message is stored in, specify 65535 for the CCSID parameter, and the CCSID is returned in the TXTCCSID parameter. You can also check for a conversion error by comparing the CCSID you passed in against the TXTCCSID returned. If they are not equal and they are not 65535, a conversion error occurred. The variable must be a decimal variable having a length of 5 positions.
</p>
</div>
<table width="100%">
<tr><td align="right"><a href="#RCVMSG.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="RCVMSG.DTACCSID"></a>
<h3>CL var for data CCSID (5 0) (DTACCSID)</h3>
<p>Specifies the name of the CL variable, if any, used to return the coded character set identifier (CCSID) associated with the replacement data defined as *CCHAR. All other replacement data is not converted before it is returned. If a conversion error occurs or if the CCSID you requested the text to be converted to is 65535, the CCSID message data is returned. If there is no *CCHAR replacement data in the data, 65535 is returned. Otherwise, the CCSID you wanted the text converted to is returned. For immediate messages, 0 is returned. You can check for a conversion error by comparing the CCSID you passed in against the DTACCSID returned. If they are not equal and they are not 65535, a conversion error occurred. The variable must be a decimal variable having a length of 5 positions.
</p>
</div>
<table width="100%">
<tr><td align="right"><a href="#RCVMSG.Top_Of_Page">Top</a></td></tr>
</table>
<hr size="2" width="100%">
<div><h3><a name="RCVMSG.COMMAND.EXAMPLES">Examples</a> </h3>
<p><b>Example 1: Receiving a Message</b>
</p>
<p>
<pre>
RCVMSG MSGQ(SMITH) MSGKEY(&amp;KEY) MSG(&amp;WORK)
</pre>
</p>
<p>This command receives the message having the message reference key specified by the program variable &amp;KEY from the message queue SMITH. The text of the message is copied into the CL variable &amp;WORK.
</p>
<p><b>Example 2: Receiving a New Message</b>
</p>
<p>
<pre>
RCVMSG MSGQ(INV) WAIT(120) MSG(&amp;WORK)
</pre>
</p>
<p>This command receives a new message from the message queue named INV into the CL variable &amp;WORK. The program waits no more than 120 seconds for the arrival of a new message if there are no new messages in the message queue. If there is more than one new message in the queue, the first message in the queue is the message received by the program.
</p>
<p><b>Example 3: Receiving a Message From a Procedure</b>
</p>
<p>
<pre>
RCVMSG PGMQ(*SAME CURRENT_MONTH_TOTALS) MSGTYPE(*EXCP)
RMV(*KEEPEXCP) MSGID(&amp;MID) MSG(&amp;MTEXT)
</pre>
</p>
<p>This command receives an exception message from the procedure CURRENT_MONTH_TOTALS. Since the specified name is more than 10 characters, the system does not search for any programs. If the message is an unhandled exception, the message is left on the call message queue as a new message and the exception is not handled by the RCVMSG command. The message ID is returned in the CL variable &amp;MID and the message text in the CL variable &amp;MTEXT. To handle the exception and remove the message, run the following RCVMSG command:
</p>
<p>
<pre>
RCVMSG PGMQ(*SAME CURRENT_MONTH_TOTALS) MSGTYPE(*EXCP)
RMV(*YES)
</pre>
</p>
<p><b>Example 4: Receiving a Message from a Program or Procedure</b>
</p>
<p>
<pre>
RCVMSG PGMQ(*SAME TARGETPGM) MSGTYPE(*EXCP) RMV(*NO)
MSGID(&amp;MID) MSG(&amp;MTEXT)
</pre>
</p>
<p>This command receives an exception message from the message queue of the program or procedure named TARGETPGM. Since the specified name is only 9 characters, the system searches both programs and procedures. Because RMV(*NO) is specified, if the message is an unhandled exception, the exception is handled by the RCVMSG command. The message is left on the message queue as an old message.
</p>
<p><b>Example 5: Receiving a Message Using Qualifiers</b>
</p>
<p>
<pre>
RCVMSG PGMQ(*SAME PRINT_RPT_FMT1 DEPTRPTS AREARPTS)
MSGTYPE(*EXCP) RMV(*YES)
MSGID(&amp;MID) MSG(&amp;MTEXT)
</pre>
</p>
<p>This command receives an exception message from the message queue of the procedure named PRINT_RPT_FMT1. The procedure must have been compiled into the module DEPTRPTS and have been bound into the bound program AREARPTS. Since RMV(*YES) is specified, the exception is handled if the exception message is for an unhandled exception. The message is always removed from the message queue.
</p>
<p><b>Example 6: Receiving a Message Using a Partial Procedure Name</b>
</p>
<p>
<pre>
RCVMSG PGMQ(*SAME 'HANDLE_FORM_NUM&gt;&gt;&gt;') MSGID(&amp;MID)
MSG(&amp;MTEXT)
</pre>
</p>
<p>This command receives a new message from the most recent procedure whose name begins with HANDLE_FORM_NUM.
</p>
</div>
<table width="100%">
<tr><td align="right"><a href="#RCVMSG.Top_Of_Page">Top</a></td></tr>
</table>
<hr size="2" width="100%">
<div><h3><a name="RCVMSG.ERROR.MESSAGES">Error messages</a> </h3>
<p><b><u>*ESCAPE Messages</u></b>
</p>
<dl>
<dt><b>CPF2401</b></dt>
<dd>Not authorized to library &amp;1.
</dd>
<dt><b>CPF2403</b></dt>
<dd>Message queue &amp;1 in &amp;2 not found.
</dd>
<dt><b>CPF2407</b></dt>
<dd>Message file &amp;1 in &amp;2 not found.
</dd>
<dt><b>CPF2408</b></dt>
<dd>Not authorized to message queue &amp;1.
</dd>
<dt><b>CPF2411</b></dt>
<dd>Not authorized to message file &amp;1 in &amp;2.
</dd>
<dt><b>CPF241C</b></dt>
<dd>Variable for SENDER parameter is too small.
</dd>
<dt><b>CPF2410</b></dt>
<dd>Message key not found in message queue &amp;1.
</dd>
<dt><b>CPF2415</b></dt>
<dd>End of requests.
</dd>
<dt><b>CPF2422</b></dt>
<dd>Reply not valid.
</dd>
<dt><b>CPF2423</b></dt>
<dd>Variable specified in SENDER parameter less than &amp;1 bytes.
</dd>
<dt><b>CPF2433</b></dt>
<dd>Function not allowed for system log message queue &amp;1.
</dd>
<dt><b>CPF2449</b></dt>
<dd>Message that should be a reply, is not a reply.
</dd>
<dt><b>CPF2450</b></dt>
<dd>Work station message queue &amp;1 not allocated to job.
</dd>
<dt><b>CPF2451</b></dt>
<dd>Message queue &amp;1 is allocated to another job.
</dd>
<dt><b>CPF247A</b></dt>
<dd>Call stack entry not found.
</dd>
<dt><b>CPF247E</b></dt>
<dd>CCSID &amp;1 is not valid.
</dd>
<dt><b>CPF2471</b></dt>
<dd>Length of field not valid.
</dd>
<dt><b>CPF2477</b></dt>
<dd>Message queue &amp;1 currently in use.
</dd>
<dt><b>CPF2479</b></dt>
<dd>Call stack entry not found.
</dd>
<dt><b>CPF2482</b></dt>
<dd>Message type &amp;1 not valid.
</dd>
<dt><b>CPF24A3</b></dt>
<dd>Value for call stack counter parameter not valid.
</dd>
<dt><b>CPF24A8</b></dt>
<dd>Value for wait time not valid.
</dd>
<dt><b>CPF24B3</b></dt>
<dd>Message type &amp;1 not valid.
</dd>
<dt><b>CPF2531</b></dt>
<dd>Message file &amp;1 in &amp;2 damaged for &amp;3.
</dd>
<dt><b>CPF2532</b></dt>
<dd>Job message queue is damaged. Job log ended.
</dd>
<dt><b>CPF2548</b></dt>
<dd>Damage to message file &amp;1 in &amp;2.
</dd>
<dt><b>CPF2551</b></dt>
<dd>Message key and message type combination not valid.
</dd>
<dt><b>CPF36F7</b></dt>
<dd>Message queue QSYSOPR is allocated to another job.
</dd>
<dt><b>CPF8127</b></dt>
<dd>&amp;8 damage on message queue &amp;4 in &amp;9. VLIC log-&amp;7.
</dd>
<dt><b>CPF8176</b></dt>
<dd>Message queue for device description &amp;4 damaged.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#RCVMSG.Top_Of_Page">Top</a></td></tr>
</table>
</body>
</html>