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

391 lines
16 KiB
HTML

<!doctype html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head><META http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Create Message Queue (CRTMSGQ)</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="CRTMSGQ.Top_Of_Page"></a>
<h2>Create Message Queue (CRTMSGQ)</h2>
<table width="100%">
<tr>
<td valign="top" align="left"><b>Where allowed to run: </b>All environments (*ALL)<br>
<b>Threadsafe: </b>Yes
</td>
<td valign="top" align="right">
<a href="#CRTMSGQ.PARAMETERS.TABLE">Parameters</a><br>
<a href="#CRTMSGQ.COMMAND.EXAMPLES">Examples</a><br>
<a href="#CRTMSGQ.ERROR.MESSAGES">Error messages</a></td>
</tr>
</table>
<div> <a name="CRTMSGQ"></a>
<p>The Create Message Queue (CRTMSGQ) command creates a user-defined message queue and stores it in a specified library. The message queue should be put in a library for which all users who are to send messages to and receive messages from the queue have *USE authority. The messages sent can be either predefined messages or immediate messages. The message queue has the following attributes initialized when it is created: the DLVRY parameter is set to *HOLD, the first element of the PGM parameter is set to *DSPMSG and the second element of the PGM parameter is set to *ALWRPY, SEV is set to 00, and RESET is set to *NO. These initialized attributes cannot be specified on the CRTMSGQ command and the CHGMSGQ command must be used to change them after the queue is created.
</p>
<p>
<b>Note: </b>Message queue QSYSOPR is shipped with a message queue full action of *WRAP. If the value is changed to *SNDMSG and the queue needs to be recreated because it was damaged, the value is reset to the shipped value of *WRAP.
</p>
</div>
<table width="100%">
<tr><td align="right"><a href="#CRTMSGQ.Top_Of_Page">Top</a></td></tr>
</table>
<hr size="2" width="100%">
<div>
<h3><a name="CRTMSGQ.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="3"><a href="#CRTMSGQ.MSGQ"><b>MSGQ</b></a></td>
<td valign="top">Message queue</td>
<td valign="top"><i>Qualified object name</i></td>
<td valign="top" rowspan="3">Required, Positional 1</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>*CURLIB</u></b></td>
</tr><tr>
<td valign="top"><a href="#CRTMSGQ.TEXT"><b>TEXT</b></a></td>
<td valign="top">Text 'description'</td>
<td valign="top"><i>Character value</i>, <b><u>*BLANK</u></b></td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top"><a href="#CRTMSGQ.FORCE"><b>FORCE</b></a></td>
<td valign="top">Force to auxiliary storage</td>
<td valign="top"><b><u>*NO</u></b>, *YES</td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top" rowspan="4"><a href="#CRTMSGQ.SIZE"><b>SIZE</b></a></td>
<td valign="top">Queue size</td>
<td valign="top"><i>Element list</i></td>
<td valign="top" rowspan="4">Optional</td>
</tr>
<tr>
<td valign="top">Element 1: Initial storage size</td>
<td valign="top">
<i>Integer</i>, <b><u>3</u></b></td>
</tr>
<tr>
<td valign="top">Element 2: Increment storage size</td>
<td valign="top">
<i>Integer</i>, <b><u>1</u></b></td>
</tr>
<tr>
<td valign="top">Element 3: Maximum increments</td>
<td valign="top">
<i>Integer</i>, <b><u>*NOMAX</u></b></td>
</tr>
<tr>
<td valign="top"><a href="#CRTMSGQ.AUT"><b>AUT</b></a></td>
<td valign="top">Authority</td>
<td valign="top"><i>Name</i>, <b><u>*LIBCRTAUT</u></b>, *CHANGE, *ALL, *USE, *EXCLUDE</td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top"><a href="#CRTMSGQ.ALWALR"><b>ALWALR</b></a></td>
<td valign="top">Allow alerts</td>
<td valign="top"><b><u>*NO</u></b>, *YES</td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top"><a href="#CRTMSGQ.CCSID"><b>CCSID</b></a></td>
<td valign="top">Coded character set ID</td>
<td valign="top">1-65535, *MSG, <b><u>*HEX</u></b>, *JOB</td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top"><a href="#CRTMSGQ.MSGQFULL"><b>MSGQFULL</b></a></td>
<td valign="top">Message queue full action</td>
<td valign="top"><b><u>*SNDMSG</u></b>, *WRAP</td>
<td valign="top">Optional</td>
</tr>
</table>
<table width="100%">
<tr><td align="right"><a href="#CRTMSGQ.Top_Of_Page">Top</a></td></tr>
</table>
</div>
<div> <a name="CRTMSGQ.MSGQ"></a>
<h3>Message queue (MSGQ)</h3>
<p>Specifies the message queue to be created.
</p>
<p>This is a required parameter.
</p>
<p><b>Qualifier 1: Message queue</b>
</p>
<dl>
<dt><b><i>name</i></b></dt>
<dd>Specify the name of the message queue being created.
</dd>
</dl>
<p><b>Qualifier 2: Library</b>
</p>
<dl>
<dt><b><u>*CURLIB</u></b></dt>
<dd>The current library for the job is used to create the message queue. If no current library entry exists in the library list, the QGPL library is used.
</dd>
<dt><b><i>name</i></b></dt>
<dd>Specify the library where the message queue is to be created.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#CRTMSGQ.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="CRTMSGQ.TEXT"></a>
<h3>Text 'description' (TEXT)</h3>
<p>Specifies the text that briefly describes the object.
</p>
<dl>
<dt><b><u>*BLANK</u></b></dt>
<dd>No text is specified.
</dd>
<dt><b><i>'description'</i></b></dt>
<dd>Enter no more than 50 characters, enclosed in apostrophes.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#CRTMSGQ.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="CRTMSGQ.FORCE"></a>
<h3>Force to auxiliary storage (FORCE)</h3>
<p>Specifies whether changes made to the message queue description or messages added to or removed from the queue are immediately forced into auxiliary storage; this ensures that changes to the queue, or messages sent or received, are not lost if a system failure occurs.
</p>
<dl>
<dt><b><u>*NO</u></b></dt>
<dd>Changes made to the message queue, including its messages, are not immediately forced to auxiliary storage.
</dd>
<dt><b>*YES</b></dt>
<dd>All changes to the message queue description and to the messages in the queue are immediately forced to auxiliary storage.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#CRTMSGQ.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="CRTMSGQ.SIZE"></a>
<h3>Queue size (SIZE)</h3>
<p>Specifies the initial storage size of the message queue, the size of each addition to its storage, and the number of times the size can be increased. The storage size is expressed in kilobytes (KB).
</p>
<p><b>Element 1: Initial storage size</b>
</p>
<dl>
<dt><b><u>3</u></b></dt>
<dd>Initially, the message queue has 3 KB of storage assigned to it. (1 KB equals 1024 bytes of storage.)
</dd>
<dt><b><i>initial-Kilobytes</i></b></dt>
<dd>Specify the initial size of the queue (must be greater than 0).
</dd>
</dl>
<p><b>Element 2: Increment storage size</b>
</p>
<p>One of the following is used to specify the amount of storage in kilobytes added to the message queue's size each time the size is increased.
</p>
<dl>
<dt><b><u>1</u></b></dt>
<dd>One KB of storage is added to the message queue each time its size is increased.
</dd>
<dt><b><i>increment-value</i></b></dt>
<dd>Specify the number of kilobytes added each time the message queue's size is increased.
</dd>
</dl>
<p><b>Element 3: Maximum increments</b>
</p>
<p>One of the following is used to specify the maximum number of times the message queue's size can be increased.
</p>
<dl>
<dt><b><u>*NOMAX</u></b></dt>
<dd>The number of times storage can be added to the message queue is not limited by the user. The maximum size is determined by the system.
</dd>
<dt><b><i>number-of-increments</i></b></dt>
<dd>Specify the maximum number of times storage can be added to the queue. Enter a 0 to prevent any additions to the initial size of the queue.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#CRTMSGQ.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="CRTMSGQ.AUT"></a>
<h3>Authority (AUT)</h3>
<p>Specifies the authority you are giving to users who do not have specific authority for the object, who are not on an authorization list, and whose group profile or supplemental group profiles do not have specific authority for the object.
</p>
<dl>
<dt><b><u>*LIBCRTAUT</u></b></dt>
<dd>The system determines the authority for the object by using the value specified for the <b>Create authority (CRTAUT)</b> parameter on the Create Library command (CRTLIB) for the library containing the object to be created. If the value specified for the CRTAUT parameter is changed, the new value will not affect any existing objects.
</dd>
</dl>
<dl>
<dt><b>*CHANGE</b></dt>
<dd>The user can perform all operations on the object except those limited to the owner or controlled by object existence (*OBJEXIST) and object management (*OBJMGT) authorities. The user can change and perform basic functions on the object. *CHANGE authority provides object operational (*OBJOPR) authority and all data authority. If the object is an authorization list, the user cannot add, change, or remove users.
</dd>
</dl>
<dl>
<dt><b>*ALL</b></dt>
<dd>The user can perform all operations except those limited to the owner or controlled by authorization list management (*AUTLMGT) authority. The user can control the object's existence, specify the security for the object, change the object, and perform basic functions on the object. The user also can change ownership of the object.
</dd>
</dl>
<dl>
<dt><b>*USE</b></dt>
<dd>The user can perform basic operations on the object, such as running a program or reading a file. The user cannot change the object. Use (*USE) authority provides object operational (*OBJOPR), read (*READ), and execute (*EXECUTE) authorities.
</dd>
</dl>
<dl>
<dt><b>*EXCLUDE</b></dt>
<dd>The user cannot access the object.
</dd>
</dl>
<dl>
<dt><b><i>name</i></b></dt>
<dd>Specify the name of an authorization list to be used for authority to the object. Users included in the authorization list are granted authority to the object as specified in the list. The authorization list must exist when the object is created.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#CRTMSGQ.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="CRTMSGQ.ALWALR"></a>
<h3>Allow alerts (ALWALR)</h3>
<p>Specifies whether the queue being created allows alerts to be generated from alert messages that are sent to it.
</p>
<dl>
<dt><b><u>*NO</u></b></dt>
<dd>Does not allow alerts to be generated from this message queue.
</dd>
<dt><b>*YES</b></dt>
<dd>Allows alerts to be generated from this message queue.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#CRTMSGQ.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="CRTMSGQ.CCSID"></a>
<h3>Coded character set ID (CCSID)</h3>
<p>Specifies the coded character set identifier (CCSID) associated with this message queue. The CCSID applies only to immediate messages and message data that is defined as a character field that can be converted (*CCHAR).
</p>
<dl>
<dt><b><u>*HEX</u></b></dt>
<dd>Messages sent to, received from, or displayed from this message queue are not converted. The message queue CCSID is 65535.
</dd>
<dt><b>*MSG</b></dt>
<dd>Messages sent to this message queue are not converted. The CCSID specified by the sending job is saved in case a conversion is needed for a display or receive function. The message queue CCSID is 65534.
</dd>
<dt><b>*JOB</b></dt>
<dd>The CCSID of the message queue will be the CCSID of the job running this command.
</dd>
<dt><b><i>coded-character-set-identifier</i></b></dt>
<dd>Specify the CCSID associated with this message queue. Messages sent to this message queue are converted to this CCSID. 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 CCSID values.
<p>For more information about 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="#CRTMSGQ.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="CRTMSGQ.MSGQFULL"></a>
<h3>Message queue full action (MSGQFULL)</h3>
<p>Specifies the action to take when the message queue is full.
</p>
<dl>
<dt><b><u>*SNDMSG</u></b></dt>
<dd>When the message queue is full, CPF2460 (Message queue could not be extended.) is sent to the program or user that is sending a message to the full message queue.
</dd>
<dt><b>*WRAP</b></dt>
<dd>When the message queue is full, the oldest informational and answered messages are removed from the message queue to allow space for new messages to be added. If the removing of the informational and answered messages does not provide enough space to add the requested message, then unanswered inquiry messages are removed until there is space to add the requested message. The default reply is sent before an unanswered inquiry message is removed. When the message queue is wrapped, CPI2420 or CPI2421 will be sent to the queue that was full to indicate it was wrapped. If there is no space on the queue to send these messages they are sent to the joblog of the user that was sending the message to the queue and they are sent to QHST if the full queue is QSYSOPR.
<p><b>NOTE:</b>
</p>
<p>When a queue uses *WRAP and a job sends a message to the queue that causes a wrap, messages are removed for the following conditions in order to perform the wrap:
</p>
<ul>
<li>the queue is in break or notify mode for a job
</li>
<li>a job is in a message wait state because it did a receive function on the queue with a wait time specified
</li>
<li>the queue is allocated by a job via the ALCOBJ command
</li>
</ul>
<p>Only the system wrap function can remove messages from queues in these conditions. Other jobs still are not allowed to remove messages from the queues during these conditions. With *SNDMSG, these conditions do not allow another job to remove messages from the queue.
</p>
<p>Also when a queue specifies *WRAP and it is in break mode, the wrap function only removes messages that have been received by the break-handling program. For example, if the break-handling program did not receive all messages from the the queue and it was becoming full, CPF2460 could be issued because messages could not be removed to perform the wrap.
</p>
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#CRTMSGQ.Top_Of_Page">Top</a></td></tr>
</table>
<hr size="2" width="100%">
<div><h3><a name="CRTMSGQ.COMMAND.EXAMPLES">Examples</a> </h3>
<p>
<pre>
CRTMSGQ MSGQ(MYQ) SIZE(3 3 *NOMAX)
TEXT('Message queue for inventory transactions')
AUT(*CHANGE)
</pre>
</p>
<p>This command creates the message queue MYQ and stores it in the current library (*CURLIB) by default. All users are authorized to send messages to the queue and to read its messages.
</p>
<p>The message queue is created with an initial size of 3 kilobytes (KB) and increased in size in 3 KB increments. The restriction on its maximum size is the system limit for objects, which is about 16,000 KB.
</p>
</div>
<table width="100%">
<tr><td align="right"><a href="#CRTMSGQ.Top_Of_Page">Top</a></td></tr>
</table>
<hr size="2" width="100%">
<div><h3><a name="CRTMSGQ.ERROR.MESSAGES">Error messages</a> </h3>
<p><b><u>*ESCAPE Messages</u></b>
</p>
<dl>
<dt><b>CPF2108</b></dt>
<dd>Object &amp;1 type *&amp;3 not added to library &amp;2.
</dd>
<dt><b>CPF2112</b></dt>
<dd>Object &amp;1 in &amp;2 type *&amp;3 already exists.
</dd>
<dt><b>CPF2113</b></dt>
<dd>Cannot allocate library &amp;1.
</dd>
<dt><b>CPF2151</b></dt>
<dd>Operation failed for &amp;2 in &amp;1 type *&amp;3.
</dd>
<dt><b>CPF2182</b></dt>
<dd>Not authorized to library &amp;1.
</dd>
<dt><b>CPF2283</b></dt>
<dd>Authorization list &amp;1 does not exist.
</dd>
<dt><b>CPF2402</b></dt>
<dd>Library &amp;1 not found
</dd>
<dt><b>CPF247E</b></dt>
<dd>CCSID &amp;1 is not valid.
</dd>
<dt><b>CPF2497</b></dt>
<dd>Size for &amp;1 in &amp;2 exceeds machine limit.
</dd>
<dt><b>CPF9838</b></dt>
<dd>User profile storage limit exceeded.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#CRTMSGQ.Top_Of_Page">Top</a></td></tr>
</table>
</body>
</html>