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

99 lines
6.3 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="Write request-processing procedures and programs" />
<meta name="abstract" content="You can specify a CL procedure as a request processor within a program." />
<meta name="description" content="You can specify a CL procedure as a request processor within a program." />
<meta name="DC.subject" content="writing, request-processing procedure" />
<meta name="keywords" content="writing, request-processing procedure" />
<meta name="DC.Relation" scheme="URI" content="rmclp.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="wrppg" />
<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>Write request-processing procedures and programs</title>
</head>
<body id="wrppg"><a name="wrppg"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">Write request-processing procedures and programs</h1>
<div><p>You can specify a CL procedure as a request processor within a
program.</p>
<div class="section"> <p>Specifying a CL procedure as a request processor within a program
has many advantages. The following list specifies three advantages: </p>
<ul><li>Processes request messages as described in <a href="rqmsg.htm#rqmsg">Receive request messages</a>.</li>
<li>Allows the use of the <span class="cmdname">End Request (ENDRQS)</span> command,
which can be used from the System Request menu or as part of the disconnect
job function.</li>
<li>Allows filtering of messages to occur.</li>
</ul>
<p>To become a request-processor procedure or program, your procedure
or program must send and receive a request message and not remove the request
message. The <span class="cmdname">Send Program Message (SNDPGMMSG)</span> and <span class="cmdname">Receive
Message (RCVMSG)</span> commands can be used to become a request processor.
For example, the following commands would allow a procedure or program to
become a request processor: </p>
<pre>SNDPGMMSG MSG('Request Message') TOPGMQ(*EXT) MSGTYPE(*RQS)
RCVMSG PGMQ(*EXT) MSGTYPE(*RQS) RMV(*NO)</pre>
<p>The request message is received from PGMQ *EXT. When any request
message is received, it is moved (actually, it is removed and resent) to the
call message queue of the procedure or program that specified the <span class="cmdname">Receive
Message (RCVMSG)</span> command. Therefore, the correct call message queue
must be used later when the message is removed.</p>
<p>If the request message
is removed using the message reference key (MRK), you should obtain the MRK
from the KEYVAR keyword of the <span class="cmdname">Receive Message (RCVMSG)</span> command
and not the <span class="cmdname">Send Program Message (SNDPGMMSG)</span> command. (The
MRK changes when receiving a request message because the request is moved
to a different call message queue.) You must specify RMV(*NO) on the <span class="cmdname">Receive
Message (RCVMSG)</span> command because the procedure or program is not
a request processor if the request message is removed from the call message
queue.</p>
<p>The procedure or program is identified as a request processor
when the request message is received. While the procedure or program is a
request processor, other called procedures or programs can be ended using
option 2 (End request) on the System Request menu. The request-processor procedure
or program should include a monitor for message CPF1907 (<span class="cmdname">Monitor
Message (MONMSG)</span> command). This is necessary because the end request
function (from either option 2 on the System Request menu or the End Request
command) sends this message to the request processor.</p>
<p>The procedure
or program remains a request processor until the procedure ends (either normally
or abnormally) or until a <span class="cmdname">Receive Message (RCVMSG)</span> command
is run to remove all the request messages from the request-processor's call
message queue. For example, the following command removes all request messages
from the message queue and, therefore, ends request processing: </p>
<pre>RMVMSG CLEAR(*ALL)</pre>
<p>Call the QCAPCMD API and specify the message reference key
to have the i5/OS™ command
analyzer to process a request message for an i5/OS command. You can get the message
reference key when you receive the request message. Process Commands (QCAPCMD)
will update the request message in the job log and add any new value supplied.
QCAPCMD also hides any parameter values, such as passwords, that are to hidden
in the job log. The system will not update the request message in the job
log when one of two conditions exists. </p>
<ul><li>Using the Execute Command (QCMDEXC or QCAEXEC) APIs.</li>
<li>Failing to supply a message reference key to QCAPCMD.</li>
</ul>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="rmclp.htm" title="You can use the Receive Message (RCVMSG) command to obtain a message from a message queue for your procedure or program. This topic includes general information on receiving messages and the details on receiving request messages and request processing programs.">Receive messages into a CL procedure or program</a></div>
</div>
</div>
</body>
</html>