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

968 lines
45 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>Add Message Description (ADDMSGD)</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="ADDMSGD.Top_Of_Page"></a>
<h2>Add Message Description (ADDMSGD)</h2>
<table width="100%">
<tr>
<td valign="top" align="left"><b>Where allowed to run: </b>All environments (*ALL)<br>
<b>Threadsafe: </b>No
</td>
<td valign="top" align="right">
<a href="#ADDMSGD.PARAMETERS.TABLE">Parameters</a><br>
<a href="#ADDMSGD.COMMAND.EXAMPLES">Examples</a><br>
<a href="#ADDMSGD.ERROR.MESSAGES">Error messages</a></td>
</tr>
</table>
<div> <a name="ADDMSGD"></a>
<p>The Add Message Description (ADDMSGD) command describes a message and stores it in a message file for later use. The message description remains in the message file until the file is deleted or until the Remove Message Description (RMVMSGD) command is used to remove it from the file. To change any of the attributes of the message description, such as its message text or severity code, use the Change Message Description (CHGMSGD) command.
</p>
<p>
<b>Note: </b>A description of how to print a single message or a group of messages is in the section entitled <i>Handling Messages</i> in the Basic System Operation information in the iSeries Information Center at http://www.ibm.com/eserver/iseries/infocenter.
</p>
<p>Substitution variables can be embedded both in the first-level and second-level message text. They can be replaced later by message data fields specified in the Retrieve Message (RTVMSG), Send User Message (SNDUSRMSG), and Send Program Message (SNDPGMMSG) commands.
</p>
<p>
<b>Note: </b>The <i>type</i> of message being defined is <i>not</i> specified in the ADDMSGD command. The type is specified in the command that actually sends the message.
</p>
<p>If the message second-level text exceeds 512 characters, it will not fit because of the OS/400 Prompter limit. In this case, enter the command on the Command Entry panel or in a CL program.
</p>
<p><b>Restrictions:</b>
</p>
<ul>
<li>To add a message description to a message file, you must have use (*USE) and add (*ADD) authorities for the message file.
</li>
</ul>
</div>
<table width="100%">
<tr><td align="right"><a href="#ADDMSGD.Top_Of_Page">Top</a></td></tr>
</table>
<hr size="2" width="100%">
<div>
<h3><a name="ADDMSGD.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"><a href="#ADDMSGD.MSGID"><b>MSGID</b></a></td>
<td valign="top">Message identifier</td>
<td valign="top"><i>Name</i></td>
<td valign="top">Required, Positional 1</td>
</tr>
<tr>
<td valign="top" rowspan="3"><a href="#ADDMSGD.MSGF"><b>MSGF</b></a></td>
<td valign="top">Message file</td>
<td valign="top"><i>Qualified object name</i></td>
<td valign="top" rowspan="3">Required, Positional 2</td>
</tr>
<tr>
<td valign="top">Qualifier 1: Message file</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="#ADDMSGD.MSG"><b>MSG</b></a></td>
<td valign="top">First-level message text</td>
<td valign="top"><i>Character value</i></td>
<td valign="top">Required, Positional 3</td>
</tr>
<tr>
<td valign="top"><a href="#ADDMSGD.SECLVL"><b>SECLVL</b></a></td>
<td valign="top">Second-level message text</td>
<td valign="top"><i>Character value</i>, <b><u>*NONE</u></b></td>
<td valign="top">Optional, Positional 4</td>
</tr>
<tr>
<td valign="top"><a href="#ADDMSGD.SEV"><b>SEV</b></a></td>
<td valign="top">Severity code</td>
<td valign="top">0-99, <b><u>00</u></b></td>
<td valign="top">Optional, Positional 5</td>
</tr>
<tr>
<td valign="top" rowspan="4"><a href="#ADDMSGD.FMT"><b>FMT</b></a></td>
<td valign="top">Message data fields formats</td>
<td valign="top">Single values: <b><u>*NONE</u></b><br>Other values (up to 99 repetitions): <i>Element list</i></td>
<td valign="top" rowspan="4">Optional</td>
</tr>
<tr>
<td valign="top">Element 1: Data type</td>
<td valign="top">
*QTDCHAR, *CHAR, *HEX, *SPP, *DEC, *BIN, *UBIN, *CCHAR, *DTS, *SYP, *ITV</td>
</tr>
<tr>
<td valign="top">Element 2: Length</td>
<td valign="top">
<i>Integer</i>, <b><u>*VARY</u></b></td>
</tr>
<tr>
<td valign="top">Element 3: *VARY bytes or dec pos</td>
<td valign="top">
<i>Integer</i>, <b><u>0</u></b></td>
</tr>
<tr>
<td valign="top"><a href="#ADDMSGD.TYPE"><b>TYPE</b></a></td>
<td valign="top">Reply type</td>
<td valign="top"><b><u>*CHAR</u></b>, *DEC, *ALPHA, *NAME, *NONE</td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top" rowspan="3"><a href="#ADDMSGD.LEN"><b>LEN</b></a></td>
<td valign="top">Maximum reply length</td>
<td valign="top">Single values: <b><u>*TYPE</u></b>, *NONE<br>Other values: <i>Element list</i></td>
<td valign="top" rowspan="3">Optional</td>
</tr>
<tr>
<td valign="top">Element 1: Length</td>
<td valign="top">
<i>Integer</i></td>
</tr>
<tr>
<td valign="top">Element 2: Decimal positions</td>
<td valign="top">
<i>Integer</i></td>
</tr>
<tr>
<td valign="top"><a href="#ADDMSGD.VALUES"><b>VALUES</b></a></td>
<td valign="top">Valid reply values</td>
<td valign="top">Single values: <b><u>*NONE</u></b><br>Other values (up to 20 repetitions): <i>Character value</i></td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top" rowspan="3"><a href="#ADDMSGD.SPCVAL"><b>SPCVAL</b></a></td>
<td valign="top">Special reply values</td>
<td valign="top">Single values: <b><u>*NONE</u></b><br>Other values (up to 20 repetitions): <i>Element list</i></td>
<td valign="top" rowspan="3">Optional</td>
</tr>
<tr>
<td valign="top">Element 1: Original from-value</td>
<td valign="top">
<i>Character value</i></td>
</tr>
<tr>
<td valign="top">Element 2: Replacement to-value</td>
<td valign="top">
<i>Character value</i></td>
</tr>
<tr>
<td valign="top" rowspan="3"><a href="#ADDMSGD.RANGE"><b>RANGE</b></a></td>
<td valign="top">Range of reply values</td>
<td valign="top">Single values: <b><u>*NONE</u></b><br>Other values: <i>Element list</i></td>
<td valign="top" rowspan="3">Optional</td>
</tr>
<tr>
<td valign="top">Element 1: Lower value</td>
<td valign="top">
<i>Character value</i></td>
</tr>
<tr>
<td valign="top">Element 2: Upper value</td>
<td valign="top">
<i>Character value</i></td>
</tr>
<tr>
<td valign="top" rowspan="3"><a href="#ADDMSGD.REL"><b>REL</b></a></td>
<td valign="top">Relationship for valid replies</td>
<td valign="top">Single values: <b><u>*NONE</u></b><br>Other values: <i>Element list</i></td>
<td valign="top" rowspan="3">Optional</td>
</tr>
<tr>
<td valign="top">Element 1: Relational operator</td>
<td valign="top">
*EQ, *LE, *GE, *GT, *LT, *NE, *NL, *NG</td>
</tr>
<tr>
<td valign="top">Element 2: Value</td>
<td valign="top">
<i>Character value</i></td>
</tr>
<tr>
<td valign="top"><a href="#ADDMSGD.DFT"><b>DFT</b></a></td>
<td valign="top">Default reply value</td>
<td valign="top"><i>Character value</i>, <b><u>*NONE</u></b></td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top" rowspan="3"><a href="#ADDMSGD.DFTPGM"><b>DFTPGM</b></a></td>
<td valign="top">Default program to call</td>
<td valign="top">Single values: <b><u>*NONE</u></b><br>Other values: <i>Qualified object name</i></td>
<td valign="top" rowspan="3">Optional</td>
</tr>
<tr>
<td valign="top">Qualifier 1: Default program to call</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="#ADDMSGD.DMPLST"><b>DMPLST</b></a></td>
<td valign="top">Data to be dumped</td>
<td valign="top">Single values: *NONE<br>Other values (up to 102 repetitions): 1-99, <b><u>*JOB</u></b>, *JOBINT, *JOBDMP</td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top" rowspan="3"><a href="#ADDMSGD.LVL"><b>LVL</b></a></td>
<td valign="top">Level of message</td>
<td valign="top"><i>Element list</i></td>
<td valign="top" rowspan="3">Optional</td>
</tr>
<tr>
<td valign="top">Element 1: Creation date</td>
<td valign="top">
<i>Date</i>, <b><u>*CURRENT</u></b></td>
</tr>
<tr>
<td valign="top">Element 2: Level number</td>
<td valign="top">
1-99, <b><u>1</u></b></td>
</tr>
<tr>
<td valign="top" rowspan="3"><a href="#ADDMSGD.ALROPT"><b>ALROPT</b></a></td>
<td valign="top">Alert options</td>
<td valign="top"><i>Element list</i></td>
<td valign="top" rowspan="3">Optional</td>
</tr>
<tr>
<td valign="top">Element 1: Alert type</td>
<td valign="top">
*IMMED, *DEFER, *UNATTEND, <b><u>*NO</u></b></td>
</tr>
<tr>
<td valign="top">Element 2: Resource name variable</td>
<td valign="top">
1-99, <b><u>*NONE</u></b></td>
</tr>
<tr>
<td valign="top"><a href="#ADDMSGD.LOGPRB"><b>LOGPRB</b></a></td>
<td valign="top">Log problem</td>
<td valign="top"><b><u>*NO</u></b>, *YES</td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top"><a href="#ADDMSGD.CCSID"><b>CCSID</b></a></td>
<td valign="top">Coded character set ID</td>
<td valign="top">1-65535, <b><u>*JOB</u></b>, *HEX</td>
<td valign="top">Optional</td>
</tr>
</table>
<table width="100%">
<tr><td align="right"><a href="#ADDMSGD.Top_Of_Page">Top</a></td></tr>
</table>
</div>
<div> <a name="ADDMSGD.MSGID"></a>
<h3>Message identifier (MSGID)</h3>
<p>Specifies the message identifier under which the message is stored in the message file. Every message must have an identifier, and every identifier in the message file must be unique.
</p>
<p>This is a required parameter.
</p>
<p>The message identifier must be 7 characters in length and in the following format: <i>pppnnnn</i>
</p>
<p>The first 3 characters must be a code consisting of an alphabetic character followed by two alphanumeric (alphabetic or decimal) characters; the last 4 characters must consist of numbers ranging from 0 through 9 and characters ranging from A through F.
</p>
</div>
<table width="100%">
<tr><td align="right"><a href="#ADDMSGD.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="ADDMSGD.MSGF"></a>
<h3>Message file (MSGF)</h3>
<p>Specifies the message file where the message is to be stored.
</p>
<p>This is a required parameter.
</p>
<p><b>Qualifier 1: Message file</b>
</p>
<dl>
<dt><b><i>name</i></b></dt>
<dd>Specify the name of the message file where the message is to be stored.
</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 file. If no current library entry exists in the library list, QGPL is used.
</dd>
<dt><b><i>name</i></b></dt>
<dd>Specify the library where the message file is located.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#ADDMSGD.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="ADDMSGD.MSG"></a>
<h3>First-level message text (MSG)</h3>
<p>Specifies the text of the message being defined. This text is the message that is initially shown or printed, or sent to a program or log. A maximum of 132 characters enclosed in apostrophes can be specified, but the limitations of the display stations (their screen size) should be considered. The entire message must be enclosed in apostrophes if blanks are included in the message. To code an apostrophe for use in the message, enter a double apostrophe.
</p>
<p>This is a required parameter.
</p>
<p><b>Double-Byte Character Set Considerations</b>
</p>
<p>When entering double-byte characters on this parameter, several combinations of characters may cause errors to occur on this command. If double-byte characters contain the string, X'50Fn' (where n is a 1-digit number ranging from 0 through 9), error messages CPF2424 or CPF2431 may result.
</p>
<p><b>Coded Character Set Identifier (CCSID) Considerations</b>
</p>
<p>The text supplied for the MSG parameter is assumed to be in the CCSID of the job running this command unless the CCSID parameter is coded. If the CCSID parameter is coded, the text is assumed to be in the CCSID specified. 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>
</div>
<table width="100%">
<tr><td align="right"><a href="#ADDMSGD.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="ADDMSGD.SECLVL"></a>
<h3>Second-level message text (SECLVL)</h3>
<p>Specifies the message help that is shown to a display station user to further explain the message specified for the <b>First-level message text (MSG)</b> parameter. The user presses the Help key to request the message help. Message help can also be written to the job log if *SECLVL is specified for the <b>Log in service log (LOG)</b> parameter of the job commands.
</p>
<dl>
<dt><b><u>*NONE</u></b></dt>
<dd>There is no message help for this message description.
</dd>
<dt><b><i>'second-level-text'</i></b></dt>
<dd>Specify the message help that is shown when it is requested by the user. No more than 3000 characters enclosed in apostrophes can be specified, but display limitations must be considered.
</dd>
</dl>
<p>Message help can be formatted for the work station using three format control characters. Each must be followed by a blank.
</p>
<ul>
<li><b>&amp;N </b> Forces the message help to a new line (column 2). If the help is longer than one line, the next lines are indented to column 4 until the end of the help or until another format control character is found.
</li>
<li><b>&amp;P</b> Forces the message help to a new line, indented to column 6. If the help is longer than one line, the next lines start in column 4 until the end of the help or until another format control character is found.
</li>
<li><b>&amp;B</b> Forces the message help to a new line, starting in column 4. If the help is longer than one line, the next lines are indented to column 6 until the end of the help or until another format control character is found.
</li>
</ul>
<p><b>Double-Byte Character Set Considerations</b>
</p>
<p>When entering double-byte characters on this parameter, several combinations of characters may cause errors to occur on this command. The double-byte characters should not contain the string, X'50Fn' (where n is a 1-digit number, 0-9) or error messages CPF2424 or CPF2431 may result. Examples are: X'50F0', X'50F4', X'50F9'.
</p>
<p><b>Coded Character Set Identifier (CCSID) Considerations</b>
</p>
<p>The text supplied for the SECLVL parameter will be assumed to be in the CCSID of the job running this command unless the CCSID parameter is coded. If the CCSID parameter is coded, the text will be assumed in the CCSID specified. For more information about 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>
</div>
<table width="100%">
<tr><td align="right"><a href="#ADDMSGD.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="ADDMSGD.SEV"></a>
<h3>Severity code (SEV)</h3>
<p>Specifies the severity code of the message being defined. The severity code indicates the severity level of the condition that causes the message to be sent. (99 is the most important severity.)
</p>
<dl>
<dt><b><u>00</u></b></dt>
<dd>The severity code assigned to this message is 00. The message is an informational message.
</dd>
<dt><b><i>severity-code</i></b></dt>
<dd>Specify a value, ranging from 00 through 99, as the severity level associated with this message.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#ADDMSGD.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="ADDMSGD.FMT"></a>
<h3>Message data fields formats (FMT)</h3>
<p>Specifies the formats of up to 99 message data fields. Each field is described in this parameter by a list of attributes. These attributes specify the type of data in the field, the total length of the field, and, optionally, the number of decimal digits to the right of the decimal point. Certain data types do not require a length field. Boundary alignment requirements must be considered (for example, pointers are always aligned on 16-byte boundaries).
</p>
<p>All 99 of the message data fields can be used as substitution values in the message and message help defined in this message description. They can also be specified for the <b>Data to be dumped (DMPLST)</b> parameter and the <b>Alert options (ALROPT)</b> parameter of this command.
</p>
<p><b>Single values</b>
</p>
<dl>
<dt><b><u>*NONE</u></b></dt>
<dd>No format is being described for message fields. If *NONE is specified, or if this parameter is omitted, no message data fields can be referred to in the <b>First-level message text (MSG)</b>, <b>Second-level message text (SECLVL)</b>, <b>Data to be dumped (DMPLST)</b>, or <b>Alert options (ALROPT)</b> parameters.
</dd>
</dl>
<p><b>type [length [decimal-positions]]</b>
</p>
<p><b>Element 1: Data type</b>
</p>
<p>The first element specifies the type of data the substitution field contains and how the data is formatted when substituted in the message text. The contents of the second and third elements vary depending on the type specified. One of the following types can be specified for each field described on this parameter:
</p>
<dl>
<dt><b>*QTDCHAR</b></dt>
<dd>A character string formatted with enclosing apostrophes ('Monday, the 1st') is specified.
</dd>
<dt><b>*CHAR</b></dt>
<dd>A character string formatted without enclosing apostrophes is specified. It is an alphanumeric string that can be used, for example, to specify a name (BOB). Trailing blanks are truncated.
</dd>
<dt><b>*HEX</b></dt>
<dd>A string of bytes formatted as a hexadecimal value (X'C0F4') is specified.
</dd>
<dt><b>*DEC</b></dt>
<dd>A packed decimal number that is formatted in the message as a signed decimal value with a decimal point is specified. Values for length (required) and decimal positions (optional) are specified for this type (*DEC) to indicate the number of decimal digits and the number of digits to the right of the decimal point. Zeros to the left of the first significant digit are suppressed, and leading blanks are truncated (removed). If a decimal position other than zero is specified, a decimal point is shown in the result even if the decimal precision in the result is zeros; examples are 128.00 and 128.01 if FMT(*DEC 5 2) is specified. If the number of decimal positions is not specified, zero is assumed. The following gives two examples:
<ul>
<li>If FMT(*DEC 2) is specified for a substitution field and the message data is a packed decimal value of X'058C', the message text contains a positive value of 58 with no decimal point indicated.
</li>
<li>If FMT(*DEC 4 2) is specified and the packed value is specified as X'05810C' (3 bytes long), the text contains the formatted decimal value of 58.10.
</li>
</ul>
</dd>
<dt><b>*BIN</b></dt>
<dd>A binary value that is either 2, 4 or 8 bytes long (B'0000 0000 0011 1010') and is formatted in the message as a signed decimal value (58) is specified.
</dd>
<dt><b>*UBIN</b></dt>
<dd>A binary value that is either 2, 4 or 8 bytes long (B'0000 0000 0011 1010') and is formatted in the message as an unsigned decimal value (58) is specified.
</dd>
<dt><b>*CCHAR</b></dt>
<dd>A character string that can be converted. If data of this type is sent to a message queue that has a CCSID tag other than 65535 or 65534, the data is converted from the CCSID specified by the send function to the CCSID of the message queue. Conversions can also occur on data of this type when the data is obtained from the message queue using a receive or display function. See the Message Handler section of the Globalization topic in the iSeries Information Center at http://www.ibm.com/eserver/iseries/infocenter for more details on CCSID conversions.
</dd>
</dl>
<p>The following formats are valid only in IBM-provided message descriptions and should not be used for other messages.
</p>
<dl>
<dt><b>*DTS</b></dt>
<dd>An 8-byte field that contains a system date time stamp is specified. The date time stamp contains the date followed by one blank separator and the time. The date is formatted in the output message in the format specified by the system values QDATFMT and QDATSEP. The time is formatted as hh:mm:ss.
</dd>
<dt><b>*SPP</b></dt>
<dd>A 16-byte space pointer to data in a space object is specified. When referred to in the DMPLST parameter, the data in the space object (from the offset indicated by the pointer) for the length specified, is dumped. *SPP is not valid as a replacement field in message text.
</dd>
<dt><b>*SYP</b></dt>
<dd>A 16-byte system pointer to a system object is specified. When referred to in message text, the simple name of the system object is formatted as described in the name type, *CHAR. When referred to on the <b>Data to be dumped (DMPLST)</b> parameter, the object itself is dumped.
</dd>
<dt><b>*ITV</b></dt>
<dd>An 8-byte binary field that contains the time interval (in seconds) for wait time-out conditions is specified. The time interval is formatted in the message as a zero-suppressed zoned decimal value (15 0) representing the number of seconds to wait.
</dd>
</dl>
<p><b>Element 2: Length</b>
</p>
<p>Following the type specification, a second element can be specified to indicate the number of characters or digits that are passed in the message data. How the second element is used depends on the type specified in the first element.
</p>
<ol>
<li>If a length is not specified for *QTDCHAR, *CHAR, *HEX, or *SPP, then *VARY is assumed for the length. If *VARY is specified or assumed, the message data field passed by the SNDUSRMSG or SNDPGMMSG commands must be preceded by a 2-byte or 4-byte binary field that indicates the actual number of bytes of data being passed. However, when *SPP is specified, the length field is contained in the first bytes pointed to by the space pointer. Therefore, the 2-byte or 4-byte field must precede the data pointed to by the space pointer, and <i>not</i> precede the space pointer that is passed as part of the message data.
</li>
<li>If the type *DEC is specified, the total number of decimal digits (including the fraction) <i>must</i> be specified as the second value; the number of digits in the fraction optionally can be specified (optional) as the third value.
</li>
<li>If the type *BIN or *UBIN is specified, the message data field can be only 2, 4 or 8 bytes long; the default is 2 bytes.
</li>
<li>If the type *CCHAR is specified, the message data length field can only be *VARY. A variable length field is required because as the data in this field gets converted to different coded character set identifiers (CCSIDs), its length may change.
</li>
</ol>
<p><b>Element 3: *VARY bytes or dec pos</b>
</p>
<p>The third element is used in one of two ways, depending on the type specified in the first element: (1) If *QTDCHAR, *CHAR, *CCHAR, *HEX, or *SPP is specified, and if *VARY is specified or assumed for the second element, the third element is used with *VARY to indicate the size of the length field actually passed. The third element can be either a 2 or a 4, which is the number of bytes used to specify the length (in binary) of the passed value. (2) If *DEC is specified, the third element indicates the number of decimal positions in the decimal value. If not specified, the default is 0 decimal positions.
</p>
<p>
<b>Note: </b>If an object has been damaged or deleted, the substitution variable is not replaced by the object name when it is displayed; instead, the variable appears as &amp;n, where n = number. Also, if the length of the message data that is passed to the substitution variable is shorter than the length specified, the substitution value becomes a null field.
</p>
</div>
<table width="100%">
<tr><td align="right"><a href="#ADDMSGD.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="ADDMSGD.TYPE"></a>
<h3>Reply type (TYPE)</h3>
<p>Specifies the type of reply that can be made to an inquiry or notify message.
</p>
<dl>
<dt><b><u>*CHAR</u></b></dt>
<dd>Any character string is valid. If it is a quoted character string, the apostrophes are passed as part of the character string.
</dd>
<dt><b>*NONE</b></dt>
<dd>No reply type is specified. *NONE must also be specified for the <b>Maximum reply length (LEN)</b> parameter.
</dd>
<dt><b>*DEC</b></dt>
<dd>Only a decimal number is a valid reply.
</dd>
<dt><b>*ALPHA</b></dt>
<dd>Only an alphabetic string is valid. Blanks are not allowed.
</dd>
<dt><b>*NAME</b></dt>
<dd>Only a simple name is a valid reply. The name does not have to be an object name, but it must start with an alphabetic character; the remaining characters must be alphanumeric.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#ADDMSGD.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="ADDMSGD.LEN"></a>
<h3>Maximum reply length (LEN)</h3>
<p>Specifies the maximum length of a reply to an inquiry or notify message. The values specified apply <i>only</i> if one or more of the other validity checking parameters are specified. If none of the validity checking parameters are specified, the reply can contain up to 132 characters.
</p>
<p><b>Single values</b>
</p>
<dl>
<dt><b><u>*TYPE</u></b></dt>
<dd>The maximum length is determined by the type of reply specified for the <b>Reply type (TYPE)</b> parameter The maximum length for each type of reply is:
<ul>
<li>Up to 32 characters can be specified for types *CHAR and *ALPHA (132 characters if no additional validity checking is being performed).
</li>
<li>Up to 15 digits are specified for *DEC, of which a maximum of 9 digits can be to the right of the decimal point.
</li>
<li>Up to 10 alphanumeric characters are specified for *NAME.
</li>
</ul>
</dd>
<dt><b>*NONE</b></dt>
<dd>No reply length is specified. *NONE must also be specified for the <b>Reply type (TYPE)</b> parameter.
</dd>
</dl>
<p><b>Element 1: Length</b>
</p>
<dl>
<dt><b><i>length</i></b></dt>
<dd>Specify the maximum length allowed for the message reply.
</dd>
</dl>
<p><b>Element 2: Decimal positions</b>
</p>
<dl>
<dt><b><i>decimal-positions</i></b></dt>
<dd>If *DEC is specified for the <b>Reply type (TYPE)</b> parameter, specify the number of decimal positions allowed for the message reply.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#ADDMSGD.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="ADDMSGD.VALUES"></a>
<h3>Valid reply values (VALUES)</h3>
<p>Specifies a list of values of which one can be received as a valid reply to an inquiry or notify message. No more than 20 values can be specified in the list. Each value in the list must meet the requirements specified for message replies for the <b>Reply type (TYPE)</b> parameter and the <b>Maximum reply length (LEN)</b> parameter. If this parameter is specified, the <b>Range of reply values (RANGE)</b> parameter and the <b>Relationship for valid replies (REL)</b> parameter cannot be specified.
</p>
<p><b>Single values</b>
</p>
<dl>
<dt><b><u>*NONE</u></b></dt>
<dd>No list of reply values is specified.
</dd>
</dl>
<p><b>Other values</b>
</p>
<dl>
<dt><b><i>compare-value</i></b></dt>
<dd>Specify a list of up to 20 values to compare with a reply value that is sent in response to the message defined in this message description. The maximum length of each value is 32 characters.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#ADDMSGD.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="ADDMSGD.SPCVAL"></a>
<h3>Special reply values (SPCVAL)</h3>
<p>Specifies a list of up to 20 sets of special values of which one set is used as the reply to an inquiry or notify message. The reply sent is compared to the from-value in each set; if a match is found, and a to-value was specified in that set, the to-value is sent as the reply. If no to-value was specified, the from-value is sent as the reply.
</p>
<p>The to-value must meet the requirements specified on the <b>Reply type (TYPE)</b> parameter and the <b>Maximum reply length (LEN)</b> parameter.
</p>
<p><b>Single values</b>
</p>
<dl>
<dt><b><u>*NONE</u></b></dt>
<dd>No special values are specified for the replies to this message.
</dd>
</dl>
<p><b>Element 1: Original from-value</b>
</p>
<dl>
<dt><b><i>from-value</i></b></dt>
<dd>Specify a from-value to compare to a message reply value.
</dd>
</dl>
<p><b>Element 2: Replacement to-value</b>
</p>
<dl>
<dt><b><i>to-value</i></b></dt>
<dd>Specify a to-value that the from-value will be mapped to before the reply is sent.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#ADDMSGD.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="ADDMSGD.RANGE"></a>
<h3>Range of reply values (RANGE)</h3>
<p>Specifies the upper and lower value limits for valid replies sent to an inquiry or notify message. These values must meet the requirements specified on the <b>Reply type (TYPE)</b> parameter and the <b>Maximum reply length (LEN)</b> parameter, and both values must be of the same type.
</p>
<p>If this parameter is specified, the <b>Valid reply values (VALUES)</b> parameter and the <b>Relationship for valid replies (REL)</b> parameter cannot be specified.
</p>
<p><b>Single values</b>
</p>
<dl>
<dt><b><u>*NONE</u></b></dt>
<dd>No range values are specified for the replies to this message.
</dd>
</dl>
<p><b>Element 1: Lower value</b>
</p>
<dl>
<dt><b><i>lower-value</i></b></dt>
<dd>Specify the lower limit value for valid replies to this message.
</dd>
</dl>
<p><b>Element 2: Upper value</b>
</p>
<dl>
<dt><b><i>upper-value</i></b></dt>
<dd>Specify the upper limit value for valid replies to this message.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#ADDMSGD.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="ADDMSGD.REL"></a>
<h3>Relationship for valid replies (REL)</h3>
<p>Specifies the relationship that must be met for a valid reply to an inquiry or notify message. The value specified must meet the requirements specified for replies on the <b>Reply type (TYPE)</b> parameter and the <b>Maximum reply length (LEN)</b> parameter.
</p>
<p>If this parameter is specified, <b>Valid reply values (VALUES)</b> parameter and the <b>Range of reply values (RANGE)</b> parameter cannot be specified.
</p>
<p><b>Single values</b>
</p>
<dl>
<dt><b><u>*NONE</u></b></dt>
<dd>No relationship values are specified for the replies to this message.
</dd>
</dl>
<p><b>Element 1: Relational operator</b>
</p>
<dl>
<dt><b><i>operator-value</i></b></dt>
<dd>Specify one of the relational operators and the value against which the message reply is validity checked.
<ul>
<li>*LT -- Less than
</li>
<li>*LE -- Less than or equal to
</li>
<li>*GT -- Greater than
</li>
<li>*GE -- Greater than or equal to
</li>
<li>*EQ -- Equal to
</li>
<li>*NL -- Not less than
</li>
<li>*NG -- Not greater than
</li>
<li>*NE -- Not equal to
</li>
</ul>
</dd>
</dl>
<p><b>Element 2: Value</b>
</p>
<dl>
<dt><b><i>value</i></b></dt>
<dd>Specify the value to be used to compare against a message reply value.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#ADDMSGD.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="ADDMSGD.DFT"></a>
<h3>Default reply value (DFT)</h3>
<p>Specifies, if the message is sent as an inquiry or notify message, the default reply that is used when the receiver of the message has indicated that all incoming messages are to receive default replies, or when a message is deleted from a message queue and no reply is specified. The default reply must meet the requirements specified for replies on the <b>Reply type (TYPE)</b> parameter and the <b>Maximum reply length (LEN)</b> parameter.
</p>
<dl>
<dt><b><u>*NONE</u></b></dt>
<dd>No default reply is specified for the replies to this message.
</dd>
<dt><b><i>'default-reply'</i></b></dt>
<dd>Specify the default reply to send (enclosed in apostrophes if it contains special characters) to inquiry or notify messages.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#ADDMSGD.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="ADDMSGD.DFTPGM"></a>
<h3>Default program to call (DFTPGM)</h3>
<p>Specifies the qualified name of any default program called to take default action if this message is sent as an escape message to a program or procedure that is not monitoring for it. This parameter is ignored if the message is <i>not</i> sent as an escape message. If the message <i>is</i> sent as an escape message, the following parameters are passed to the specified default program:
</p>
<ul>
<li>The name of the program or procedure to which the message is sent (277 characters). The program name, module name, procedure name, and program type of the call message queue to which the message is sent. This is the same name as the program or procedure that did not monitor for the escape message.
<p>Characters 1 through 10 are the name of the program to which the message is sent.
</p>
<p>Characters 11 through 20 are the name of the module to which the message is sent. If the message is not sent to an ILE procedure, the value *N is returned in this field padded on the right with blanks.
</p>
<p>Characters 21 through 276 are the name of the procedure to which the message is sent. If the message is not sent to an ILE procedure, the value *N is returned in this field padded on the right with blanks.
</p>
<p>Character 277 is set to the value 1 if the message is sent to an ILE procedure, or to the value 0 if the message is not sent to an ILE procedure.
</p>
</li>
<li>Message reference key (4 characters). The message reference key of the escape message on the program message queue.
</li>
</ul>
<p><b>Single values</b>
</p>
<dl>
<dt><b><u>*NONE</u></b></dt>
<dd>No default program is specified for this message.
</dd>
</dl>
<p><b>Qualifier 1: Default program to call</b>
</p>
<dl>
<dt><b><i>name</i></b></dt>
<dd>Specify the name of the default program that is called when an escape message is sent.
</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 program. 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 program is located.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#ADDMSGD.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="ADDMSGD.DMPLST"></a>
<h3>Data to be dumped (DMPLST)</h3>
<p>Specifies the data that is dumped when this message is sent as an escape message to a program that is not monitoring for it. This parameter can specify that data related to the job be dumped, that data from message data fields be dumped, or that a combination of these be dumped.
</p>
<p><b>Single values</b>
</p>
<dl>
<dt><b>*NONE</b></dt>
<dd>There is no dump list for this message. No dump occurs.
</dd>
</dl>
<p><b>Other values</b>
</p>
<dl>
<dt><b><u>*JOB</u></b></dt>
<dd>This value is the equivalent of specifying * for the <b>Job name (JOB)</b> parameter and *PRINT for the <b>Output (OUTPUT)</b> parameter of the Display Job (DSPJOB) command.
</dd>
<dt><b>*JOBDMP</b></dt>
<dd>The data areas of the job are dumped as specified by the Dump Job (DMPJOB) command. *JOBDMP can be specified by itself, with *JOB, with *JOBINT, or with a list of message data field numbers.
</dd>
<dt><b>*JOBINT</b></dt>
<dd>The internal machine data structures, related to the machine process in which the job is running, are dumped to the machine error log. *JOBINT can be specified by itself, with *JOBDMP, *JOB, or with a list of message data field numbers.
</dd>
<dt><b><i>message-data-field-number</i></b></dt>
<dd>Specify the numbers of the message data fields that identify the data that is dumped when this escape message is sent but not monitored. A maximum of 99 data field numbers can be specified.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#ADDMSGD.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="ADDMSGD.LVL"></a>
<h3>Level of message(LVL)</h3>
<p>Specifies the level identifier of the message description being defined. The level identifier is made up of the date on which the message is defined and a 2-digit number that makes the identifier unique.
</p>
<p><b>Element 1: Creation date</b>
</p>
<dl>
<dt><b><u>*CURRENT</u></b></dt>
<dd>The current date is used as the first part of the message description level identifier.
</dd>
<dt><b><i>creation-date</i></b></dt>
<dd>Specify the date on which the message description is being defined.
</dd>
</dl>
<p><b>Element 2: Level number</b>
</p>
<dl>
<dt><b><u>1</u></b></dt>
<dd>The number 1 is used as the second part of the message description level identifier.
</dd>
<dt><b><i>1-99</i></b></dt>
<dd>Specify a number (ranging from 1 through 99) that makes the level identifier of the message description unique.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#ADDMSGD.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="ADDMSGD.ALROPT"></a>
<h3>Alert options (ALROPT)</h3>
<p>Specifies the alert option associated with messages sent to the system operator message queue (QSYSOPR). Alerts can be used to send a message to the host system indicating that an error has occurred on this system.
</p>
<p><b>Element 1: Alert type</b>
</p>
<dl>
<dt><b><u>*NO</u></b></dt>
<dd>No alert is sent.
</dd>
<dt><b>*IMMED</b></dt>
<dd>An alert is sent immediately, simultaneous with sending the message to QHST or QSYSOPR.
</dd>
<dt><b>*UNATTEND</b></dt>
<dd>An alert is sent immediately only when *UNATTEND is specified for the <b>Alert status (ALRSTS)</b> parameter of the Change Network Attributes (CHGNETA) command.
</dd>
<dt><b>*DEFER</b></dt>
<dd>The alert is sent after local problem analysis. *DEFER should be specified only for those messages against which problem analysis can be run. An alert is sent at the first exit from problem analysis for the problem referred to by the message. All alerts set to *DEFER are treated as *IMMED if:
<ul>
<li>*UNATTEND is specified for the <b>Alert status (ALRSTS)</b> parameter of the Change Network Attributes (CHGNETA) command.
</li>
<li>An error log ID is not available for a problem that might be resolved using problem analysis.
</li>
<li>*NO is specified for the <b>Log problem (LOGPRB)</b> parameter (problem analysis is not available for the condition reported by the message).
</li>
</ul>
</dd>
</dl>
<p><b>Element 2: Resource name variable</b>
</p>
<dl>
<dt><b><u>*NONE</u></b></dt>
<dd>No message data field format number is passed with the alert identifier.
</dd>
<dt><b><i>1-99</i></b></dt>
<dd>Specify the message data field format number that is passed with the alert identifier.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#ADDMSGD.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="ADDMSGD.LOGPRB"></a>
<h3>Log problem (LOGPRB)</h3>
<p>Specifies, for IBM-supplied messages, whether an entry is put into the problem log. If there is an error log ID for the message and *YES is specified for this parameter, the user can request problem analysis by pressing F14 from the system operator message queue display (by running the DSPMSG *SYSOPR command).
</p>
<dl>
<dt><b><u>*NO</u></b></dt>
<dd>An entry is not put in the problem log.
</dd>
<dt><b>*YES</b></dt>
<dd>An entry is put in the problem log if there is an error log ID associated with this message.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#ADDMSGD.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="ADDMSGD.CCSID"></a>
<h3>Coded character set ID (CCSID)</h3>
<p>Specifies the coded character set identification (CCSID) that the text supplied for the MSG and SECLVL parameters is in. If the message file that this message description is being added to is not 65534 or 65535, the text supplied is converted from the CCSID specified to the CCSID of the message file. Otherwise, the text is not converted but the CCSID is saved in case a conversion is needed during a retrieve or display function. 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>
<dl>
<dt><b><u>*JOB</u></b></dt>
<dd>The text for this message description is assumed to be in the CCSID of the job running this command.
</dd>
<dt><b>*HEX</b></dt>
<dd>The text for this message description is not converted and is tagged 65535.
</dd>
<dt><b><i>coded-character-set-identifier</i></b></dt>
<dd>Specify the CCSID you want the text to be considered in. Valid values range form 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. Only CCSIDs that a job can be changed to are accepted.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#ADDMSGD.Top_Of_Page">Top</a></td></tr>
</table>
<hr size="2" width="100%">
<div><h3><a name="ADDMSGD.COMMAND.EXAMPLES">Examples</a> </h3>
<p><b>Example 1: Defining a Message</b>
</p>
<p>
<pre>
ADDMSGD MSGID(UIN0115) MSGF(INV)
MSG('Enter the name of user''s department')
SECLVL('Valid departments: &amp;B X12 &amp;B X13 &amp;B X14')
TYPE(*CHAR) LEN(3) DFT('ZZZ')
</pre>
</p>
<p>This command defines a message and stores it in a file named INV under the identifier UIN0115. The message supplies second-level message text by using the &amp;B formatting character to show the three valid department names (X12, X13, and X14) each on a separate line. The reply requires validity checking so that a valid reply can only be a 3-character identifier. A default reply of ZZZ is also provided.
</p>
<p><b>Example 2: Defining a Message Description</b>
</p>
<p>
<pre>
ADDMSGD MSGID(UPY0047) MSGF(PAYLIB/TIMECARD)
MSG('For week of &amp;1, &amp;2 time cards. Are there more?')
FMT((*CHAR 8) (*CHAR 3)) TYPE(*ALPHA) LEN(1)
VALUES(N Y) SPCVAL((YES Y)(NO N)) DFT(N)
</pre>
</p>
<p>This command defines a message description that is stored in the TIMECARD message file in the PAYLIB library. The program that processes the time cards can send a message (as an inquiry type message) telling how many time cards (in &amp;2) have been processed for the week (specified in &amp;1). To send this message to a user via a message queue, the program must use the SNDPGMMSG or SNDUSRMSG commands. In this example, the command specifies:
</p>
<ul>
<li>The message identifier of this message (UPY0047)
</li>
<li>The file (TIMECARD) that contains this message
</li>
<li>The time card date in 8 characters (such as 09/15/88); this must be the first value in the MSGDTA parameter
</li>
<li>The number of time cards in no more than 3 digits (such as 125)
</li>
</ul>
<p>If a reply of YES is sent, it is accepted as a Y (SPCVAL parameter). If NO is sent, it is accepted as an N. If neither YES nor NO is sent, the reply is checked for validity by the TYPE, LEN, and VALUES parameters. If the user chooses, no reply is sent and the default reply (N) is assumed.
</p>
<p><b>Example 3: Defining an Escape Message</b>
</p>
<p>
<pre>
ADDMSGD MSGID(UPY1234) MSGF(PAYLIB/TIMECARD)
MSG('Tax for employee &amp;1 exceeds gross salary.')
SEV(75) FMT((*CHAR 6) (*DEC 9 2) (*CHAR 8))
DFTPGM(PAYLIB/BADTAX) DMPLST(1 2 3 *JOB)
</pre>
</p>
<p>This command defines an escape message. The sender of the message passes three data values, the first of which (employee serial number) is used as replacement text in the message. If this message is sent as an escape message and the program to which the message is sent does not monitor for message UPY1234, default system action is taken. This includes dumping the three data values that were passed and the job structure. After the dump is taken, program BADTAX is called.
</p>
<p>See the Monitor Message (MONMSG) command for more about monitoring for messages.
</p>
</div>
<table width="100%">
<tr><td align="right"><a href="#ADDMSGD.Top_Of_Page">Top</a></td></tr>
</table>
<hr size="2" width="100%">
<div><h3><a name="ADDMSGD.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>CPF2407</b></dt>
<dd>Message file &amp;1 in &amp;2 not found.
</dd>
<dt><b>CPF2411</b></dt>
<dd>Not authorized to message file &amp;1 in &amp;2.
</dd>
<dt><b>CPF2412</b></dt>
<dd>Message ID &amp;1 already exists in message file &amp;2 in &amp;3.
</dd>
<dt><b>CPF2430</b></dt>
<dd>Message description not added to message file
</dd>
<dt><b>CPF2461</b></dt>
<dd>Message file &amp;1 could not be extended.
</dd>
<dt><b>CPF2483</b></dt>
<dd>Message file currently in use.
</dd>
<dt><b>CPF2510</b></dt>
<dd>Message file &amp;1 in &amp;2 logically damaged.
</dd>
<dt><b>CPF9830</b></dt>
<dd>Cannot assign library &amp;1.
</dd>
<dt><b>CPF9838</b></dt>
<dd>User profile storage limit exceeded.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#ADDMSGD.Top_Of_Page">Top</a></td></tr>
</table>
</body>
</html>