107 lines
6.5 KiB
HTML
107 lines
6.5 KiB
HTML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE html
|
|
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html lang="en-us" xml:lang="en-us">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
<meta name="security" content="public" />
|
|
<meta name="Robots" content="index,follow" />
|
|
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
|
|
<meta name="DC.Type" content="task" />
|
|
<meta name="DC.Title" content="Retrieve message descriptions from a message file" />
|
|
<meta name="abstract" content="You can retrieve the text of a message from a message file into a variable in a CL procedure." />
|
|
<meta name="description" content="You can retrieve the text of a message from a message file into a variable in a CL procedure." />
|
|
<meta name="DC.subject" content="retrieving, message in CL procedure, message, in CL procedure, from CL procedure, RTVMSG (Retrieve Message) command, Retrieve Message (RTVMSG) command, command, CL, RTVMSG (Retrieve Message), Retrieve Message (RTVMSG)" />
|
|
<meta name="keywords" content="retrieving, message in CL procedure, message, in CL procedure, from CL procedure, RTVMSG (Retrieve Message) command, Retrieve Message (RTVMSG) command, command, CL, RTVMSG (Retrieve Message), Retrieve Message (RTVMSG)" />
|
|
<meta name="DC.Relation" scheme="URI" content="wmsgs.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="rmtcl" />
|
|
<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>Retrieve message descriptions from a message file</title>
|
|
</head>
|
|
<body id="rmtcl"><a name="rmtcl"><!-- --></a>
|
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
|
<h1 class="topictitle1">Retrieve message descriptions from a message file</h1>
|
|
<div><p>You can retrieve the text of a message from a message file into
|
|
a variable in a CL procedure.</p>
|
|
<div class="section"> <p>You can do this using the <span class="cmdname">Retrieve Message (RTVMSG)</span> command. <span class="cmdname">Retrieve
|
|
Message (RTVMSG)</span> operates on predefined message descriptions. You
|
|
can specify the message identifier and message file name in addition to the
|
|
following:</p>
|
|
<ul><li>CCSID to convert to. Specifies the coded character set identifier that
|
|
you want your message text and data returned in.</li>
|
|
<li>Message data fields. The message data to be inserted for the substitution
|
|
variables.</li>
|
|
<li>Message data CCSID. Specifies the coded character set identifier that
|
|
the supplied message data is to be considered in.</li>
|
|
<li>A group of CL variables into which the following information is placed
|
|
(each corresponds to one variable): <ul><li>Message (character variable, length varies)</li>
|
|
<li>Length of message, including length of substitution variable data (decimal
|
|
variable, 5 decimal positions)</li>
|
|
<li>Message help information (character variable, length varies)</li>
|
|
<li>Length of message help, including length of substitution variable data
|
|
(decimal variable, 5 decimal positions)</li>
|
|
<li>Severity code (decimal variable, 2 decimal positions)</li>
|
|
<li>Alert option (character variable, 9 characters)</li>
|
|
<li>Log problem in the service activity log (character variable, 1 character)</li>
|
|
<li>Message data CCSID is the coded character set identifier associated with
|
|
the replacement data returned (decimal variable, 5 decimal positions)</li>
|
|
<li>Text data CCSID is the coded character set identifier associated with
|
|
the text returned by the Message and the Message help parameters (decimal
|
|
variable, 5 decimal positions)</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
<p>For example, the following command adds the message description for
|
|
the message USR1001 to the message file USRMSG: </p>
|
|
<pre>ADDMSGD MSGID(USR1001) MSGF(QGPL/USRMSG) +
|
|
MSG('File &1 not found in library &2') +
|
|
SECLVL('Change file name or library name') +
|
|
SEV(40) FMT((*CHAR 10) (*CHAR 10))</pre>
|
|
<p>The following commands result in the substitution of the file
|
|
name INVENT in the 10-character variable &FILE and the library name QGPL
|
|
in the 10-character variable &LIB in the retrieved message <samp class="codeph">USR1001.</samp> </p>
|
|
<pre>DCL &FILE TYPE(*CHAR) LEN(10) VALUE(INVENT)
|
|
DCL &LIB TYPE(*CHAR) LEN(10) VALUE(QGPL)
|
|
DCL &A TYPE(*CHAR) LEN(20)
|
|
DCL &MSG TYPE(*CHAR) LEN(50)
|
|
CHGVAR VAR(&A) VALUE(&FILE||&LIB)
|
|
RTVMSG MSGID(USR1001) MSGF(QGPL/USRMSG) +
|
|
MSGDTA(&A) MSG(&MSG)</pre>
|
|
<p>The data for substitution variable &1 and &2 is contained
|
|
in the procedure variable &A, in which the values of the procedure variables &FILE
|
|
and &LIB have been concatenated. When the retrieve command is done, the
|
|
following message is placed in the CL variable &MSG: </p>
|
|
<pre> File INVENT not found in library QGPL</pre>
|
|
<p>If the MSGDTA parameter is not used in the <span class="cmdname">Retrieve
|
|
Message (RTVMSG)</span> command, the following message is placed in the
|
|
CL variable &MSG:</p>
|
|
<pre> File not found in library</pre>
|
|
<p>After the message is placed in the variable &MSG, you could
|
|
do the following: </p>
|
|
<ul><li>Send the message using the <span class="cmdname">Send Program Message (SNDPGMMSG)</span> command</li>
|
|
<li>Use the variable as the text for a message line in DDS (M in position
|
|
38)</li>
|
|
<li>Use a message subfile</li>
|
|
<li>Print or display the message</li>
|
|
</ul>
|
|
<div class="note"><span class="notetitle">Note:</span> You cannot retrieve the message text with the substitution variable
|
|
names that are included in the text. The system intends on <span class="cmdname">Retrieve
|
|
Message (RTVMSG)</span> to return a sendable message.</div>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="wmsgs.htm" title="This discusses some of the ways that messages can be used to communicate between users and programs.">Messages</a></div>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html> |