ibm-information-center/dist/eclipse/plugins/i5OS.ic.rbam6_5.4.0.1/dsvam.htm

153 lines
10 KiB
HTML
Raw Permalink Normal View History

2024-04-02 14:02:31 +00:00
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-us" xml:lang="en-us">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="security" content="public" />
<meta name="Robots" content="index,follow" />
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
<meta name="DC.Type" content="task" />
<meta name="DC.Title" content="Define substitution variables" />
<meta name="abstract" content="On the FMT parameter on the Add Message Description (ADDMSGD) command, you can specify substitution variables for either first- or second-level messages." />
<meta name="description" content="On the FMT parameter on the Add Message Description (ADDMSGD) command, you can specify substitution variables for either first- or second-level messages." />
<meta name="DC.subject" content="ADDMSGD (Add Message Description) command, FMT (format) parameter, Add Message Description (ADDMSGD) command, FMT (format) parameter, command, CL, ADDMSGD (Add Message Description), defining substitution variables, command, CL, Add Message Description (ADDMSGD), defining substitution variables, message description, adding, substitution variable, message description, message, defining, substitution variable, variable, substitution" />
<meta name="keywords" content="ADDMSGD (Add Message Description) command, FMT (format) parameter, Add Message Description (ADDMSGD) command, FMT (format) parameter, command, CL, ADDMSGD (Add Message Description), defining substitution variables, command, CL, Add Message Description (ADDMSGD), defining substitution variables, message description, adding, substitution variable, message description, message, defining, substitution variable, variable, substitution" />
<meta name="DC.Relation" scheme="URI" content="amsgf.htm" />
<meta name="DC.Relation" scheme="URI" content="hlformat.htm" />
<meta name="copyright" content="(C) Copyright IBM Corporation 1998, 2006" />
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 1998, 2006" />
<meta name="DC.Format" content="XHTML" />
<meta name="DC.Identifier" content="dsvam" />
<meta name="DC.Language" content="en-us" />
<!-- All rights reserved. Licensed Materials Property of IBM -->
<!-- US Government Users Restricted Rights -->
<!-- Use, duplication or disclosure restricted by -->
<!-- GSA ADP Schedule Contract with IBM Corp. -->
<link rel="stylesheet" type="text/css" href="./ibmdita.css" />
<link rel="stylesheet" type="text/css" href="./ic.css" />
<title>Define substitution variables</title>
</head>
<body id="dsvam"><a name="dsvam"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">Define substitution variables</h1>
<div><p>On the FMT parameter on the <span class="cmdname">Add Message Description (ADDMSGD)</span> command,
you can specify substitution variables for either first- or second-level messages.</p>
<div class="section"> <p>For example:</p>
<pre>File &amp;1 not found</pre>
<p>contains the substitution variable &amp;1. When
the message is displayed or retrieved, the variable &amp;1 is replaced with
the name of the file that could not be found. This name is supplied by the
sender of the message. For example:</p>
<pre>File ORDHDRP not found</pre>
<p>Compare this to:</p>
<pre>File not found</pre>
<p>Substitution variables can make your message more specific
and more meaningful.</p>
<p>The substitution variable must begin with &amp;
(ampersand) and be followed by n, where n is any number from 1 through 99.
For example, for the message:</p>
<pre>File &amp;1 not found</pre>
<p>the substitution variable is defined as:</p>
<pre>FMT((*CHAR 10))</pre>
<p>When you assign numbers to substitution variables, you must
begin with the number 1 and use the numbers consecutively. For example, &amp;1, &amp;2, &amp;3,
and so on. However, you do not have to use all the substitution variables
defined for a message description in the message that is sent.</p>
<p>For example,
the message: </p>
<pre>File &amp;3 not available</pre>
<p>is valid even though &amp;1 and &amp;2 are not used in the
messages. However, to do this, you must define &amp;1, &amp;2, and &amp;3
on the FMT parameter of the <span class="cmdname">Add Message Description (ADDMSGD)</span> command.
For the preceding message, the FMT parameter could be:</p>
<pre>FMT((*CHAR 10) (*CHAR 2) (*CHAR 10))</pre>
<p>where the first value describes &amp;1, the second &amp;2,
and the third &amp;3. The description for &amp;1 and &amp;2 must be present
if &amp;3 is used. In addition, when this message is sent, the MSGDTA parameter
on the Send Program Message (SNDPGMMSG) command should include all the data
described on the FMT parameter. To send the preceding message, the MSGDTA
parameter should be at least 22 characters long.</p>
<p>For the preceding message,
you could also specify the FMT parameter as: </p>
<pre>FMT((*CHAR 0) (*CHAR 0) (*CHAR 10))</pre>
<p>Because &amp;1 and &amp;2 are not used in the message, they
can be described with a length of 0. Then no message data needs to be sent.
(The MSGDTA parameter on the SNDPGMMSG command needs to be only 10 characters
long in this case.)</p>
<p>An example of using &amp;3 in the message and including &amp;1
and &amp;2 in the FMT parameter is when &amp;1 and &amp;2 are specified on
the DMPLST parameter. (The DMPLST parameter specifies that the data is to
be dumped when this message is sent as an escape message to a program that
is not monitoring for it.)</p>
<p>The substitution variables do not have to
be specified in the message in the same order in which they are defined in
the FMT parameter. For example, three values can be defined in the FMT parameter
as: </p>
<pre>FMT((*CHAR 10) (*CHAR 10) (*CHAR 7))</pre>
<p>The substitution variables can be used in the message as follows:
</p>
<pre>Object &amp;1 of type &amp;3 in library &amp;2 is not available</pre>
<p>If this message is sent in a CL procedure or program, you can
concatenate the values used for the message data such as: </p>
<pre>SNDPGMMSG .....MSGDTA(&amp;OBJ *CAT &amp;LIB *CAT &amp;OBJTYPE)</pre>
<p>You must specify the format of the message data field for the
substitution variable by specifying data type and, optionally, length on the <span class="cmdname">Add
Message Description (ADDMSGD)</span> command. The valid data types for
message data fields are: </p>
<ul><li>Quoted character string (*QTDCHAR). A string of character data to be
enclosed in apostrophes. Preceding and trailing blanks are not deleted. If
length is not specified in the message description, the sender determines
the length of the field.</li>
<li>Character string (*CHAR). A string of character data not to be enclosed
in apostrophes. Trailing blanks are deleted. If length is not specified
in the message description, the sender determines the length of the field.</li>
<li>Convertible character string (*CCHAR). A string of character data not
to be enclosed in apostrophes. Trailing blanks are deleted. The length is
always determined by the sender. If data of this type is sent to a message
queue that has a CCSID tag other then 65535 or 65534, the data is converted
from the CCSID of the message data 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 <a href="../nls/rbagsccsidmsgsup2.htm">CCSID support for messages</a> for more information on the
use of message handlers with CCSIDs.</li>
<li>Hexadecimal (*HEX). A string to be preceded by the character X and enclosed
in apostrophes; each byte of the string is to be converted into two hexadecimal
characters (0 through 9 and A through F). If length is not specified in the
message description, the sender determines the length of the field.</li>
<li>Binary (*BIN). A binary integer (either 2, 4, or 8 bytes long) formatted
as a signed decimal integer. Unless provided a specified length, the system
will assume that the binary integer is 2.</li>
<li>Unsigned binary (*UBIN). An unsigned binary integer (either 2, 4 or 8
bytes long) formatted as an unsigned decimal integer. Unless provided a specified
length, the system will assume that the binary integer is 2.</li>
<li>Decimal (*DEC). A packed decimal number to be formatted as a signed decimal
number with a decimal point. Length must be specified; decimal positions default
to 0.</li>
<li>System pointer (*SYP). A 16-byte pointer to a system object. In a message
or message help, the 10-character name of the object is formatted the same
as the *CHAR type data.</li>
<li>Space pointer (*SPP). A 16-byte pointer to a program object. In a dump,
the data in the object is formatted the same as the *HEX type data. *SPP cannot
be used as substitution text in a message; it can only be used as part of
the DMPLST parameter on the <span class="cmdname">Add Message Description (ADDMSGD)</span> command.</li>
</ul>
<p>The following data types are valid only in IBM-supplied message descriptions
and should not be used for other messages: </p>
<ul><li>Time interval (*ITV). An 8-byte time interval that contains the time
to the nearest whole second for various wait time out conditions.</li>
<li>Date and time stamp (*DTS). An 8-byte system date and time stamp for
which the date is to be formatted as specified in the QDATFMT and QDATSEP
system values and the time is to be formatted as hh:mm:ss.</li>
</ul>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="amsgf.htm" title="You use the Add Message Description (ADDMSGD) command to describe your predefined messages and to add them to the message file you created.">Add messages to a file</a></div>
</div>
<div class="relconcepts"><strong>Related concepts</strong><br />
<div><a href="hlformat.htm" title="A database file is used to store the messages sent to a log message queue on the system. Because all records in a physical file have the same length and messages sent to a log have different lengths, the messages can span more than one record.">Format of the history log</a></div>
</div>
</div>
</body>
</html>