<?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="Example: Display messages from IBM-supplied commands more than once" /> <meta name="abstract" content="This example shows how to define and create a command that re-displays messages." /> <meta name="description" content="This example shows how to define and create a command that re-displays messages." /> <meta name="DC.subject" content="displaying, message, QUAL (Qualifier) statement, example, Qualifier (QUAL) statement, qualified name, example of defining for command" /> <meta name="keywords" content="displaying, message, QUAL (Qualifier) statement, example, Qualifier (QUAL) statement, qualified name, example of defining for command" /> <meta name="DC.Relation" scheme="URI" content="exdcc.htm" /> <meta name="DC.Relation" scheme="URI" content="../cl/crtcmd.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="msgcd" /> <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>Example: Display messages from IBM-supplied commands more than once</title> </head> <body id="msgcd"><a name="msgcd"><!-- --></a> <!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script> <h1 class="topictitle1">Example: Display messages from IBM-supplied commands more than once</h1> <div><p>This example shows how to define and create a command that re-displays messages.</p> <div class="section"> <p>The <span class="cmdname">Clear Output Queue (CLROUTQ)</span> command issues the completion message CPF3417, which describes the number of entries deleted, the number not deleted, and the name of the output queue. If the <span class="cmdname">Clear Output Queue (CLROUTQ)</span> command is run within a CPP, the message is still issued but it becomes a detailed message because it is not issued directly by the CPP. For example, if a user-defined <span class="cmdname">Clear Output Queue (CLROUTQ)</span> command was issued from the Programmer Menu, the message would not be displayed. You can, however, receive an IBM<sup>®</sup> message and reissue it from your CPP.</p> <p>For example, you create a command named CQ2 to clear the output queue QPRINT2.</p> <p>The command definition statements for the CQ2 command are: </p> <pre>CMD PROMPT ('Clear QPRINT2 output queue')</pre> <p>The <span class="cmdname">Create Command (CRTCMD)</span> command is: </p> <pre>CRTCMD CMD(CQ2) PGM(CQ2)</pre> <p>The CPP, which receives the completion message and displays it, is as follows: </p> <pre>PGM /* Clear QPRINT2 output queue CPP */ DCL &MSGID TYPE(*CHAR) LEN(7) DCL &MSGDTA TYPE(*CHAR) LEN(100) CLROUTQ QPRINT2 RCVMSG MSGID(&MSGID) MSGDTA(&MSGDTA) MSGTYPE(*COMP) SNDPGMMSG MSGID(&MSGID) MSGF(QCPFMSG) MSGDTA(&MSGDTA) MSGTYPE(*COMP) ENDPGM</pre> <p>The MSGDTA length for message CPF3417 is 28 bytes. However, by defining the variable &MSGDTA as 100 bytes, the same approach can be used on most messages because any unused positions are ignored.</p> </div> </div> <div> <div class="familylinks"> <div class="parentlink"><strong>Parent topic:</strong> <a href="exdcc.htm" title="This contains examples of defining and creating commands.">Examples: Define and create commands</a></div> </div> <div class="relinfo"><strong>Related information</strong><br /> <div><a href="../cl/crtcmd.htm">Create Command (CRTCMD) command</a></div> </div> </div> </body> </html>