122 lines
8.1 KiB
HTML
122 lines
8.1 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="Identify a call stack entry" />
|
||
<meta name="abstract" content="If a CL procedure is to send a message to an OPM program or another ILE procedure, you must identify the call stack entry to which the message is sent." />
|
||
<meta name="description" content="If a CL procedure is to send a message to an OPM program or another ILE procedure, you must identify the call stack entry to which the message is sent." />
|
||
<meta name="DC.subject" content="call stack, entry identification, on SNDPGMMSG, command, CL, SNDPGMMSG (Send Program Message), call stack entry" />
|
||
<meta name="keywords" content="call stack, entry identification, on SNDPGMMSG, command, CL, SNDPGMMSG (Send Program Message), call stack entry" />
|
||
<meta name="DC.Relation" scheme="URI" content="msgcl.htm" />
|
||
<meta name="DC.Relation" scheme="URI" content="callcmdbase.htm" />
|
||
<meta name="DC.Relation" scheme="URI" content="callidbyname.htm" />
|
||
<meta name="DC.Relation" scheme="URI" content="callpgmasbase.htm" />
|
||
<meta name="DC.Relation" scheme="URI" content="callrecentasbase.htm" />
|
||
<meta name="DC.Relation" scheme="URI" content="callcontrolasbase.htm" />
|
||
<meta name="DC.Relation" scheme="URI" content="callservicepgms.htm" />
|
||
<meta name="DC.Relation" scheme="URI" content="msgcallqueue.htm" />
|
||
<meta name="DC.Relation" scheme="URI" content="callcmdbase.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="callid" />
|
||
<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>Identify a call stack entry</title>
|
||
</head>
|
||
<body id="callid"><a name="callid"><!-- --></a>
|
||
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
||
<h1 class="topictitle1">Identify a call stack entry</h1>
|
||
<div><p>If a CL procedure is to send a message to an OPM program or another
|
||
ILE procedure, you must identify the call stack entry to which the message
|
||
is sent.</p>
|
||
<div class="section"> <p>The message is sent to the call message queue of the identified
|
||
call stack entry.</p>
|
||
<p>The TOPGMQ parameter of the <span class="cmdname">Send Program
|
||
Message (SNDPGMMSG)</span> command is used to identify the call stack entry
|
||
to which a message is sent. Identification of a call stack entry consists
|
||
of the following two parts: </p>
|
||
<ul><li>Specification of a base entry <p>This specification identifies a program
|
||
or procedure within the call stack (this is element 2 of TOPGMQ).</p>
|
||
</li>
|
||
<li>Offset specification of a base entry <p>The offset specification (element
|
||
1 of TOPGMQ) identifies if you send the message to the base (*SAME) or if
|
||
you send the message to the caller of the base (*PRV).</p>
|
||
</li>
|
||
</ul>
|
||
<p>The specification TOPGMQ(*PRV *) identifies the base entry as
|
||
being the one in which the procedure using the <span class="cmdname">Send Program Message
|
||
(SNDPGMMSG)</span> command is running. The offset is specified as being
|
||
one entry previous to that base. This specification identifies the caller
|
||
of the procedure which is using the command.</p>
|
||
<p>To understand how to identify
|
||
the base entry, element 2 of TOPGMQ, you also need to understand the call
|
||
stack when an ILE program is running. Two programs are used to illustrate
|
||
this. Program CLPGM1 is an OPM CL program and Program CLPGM2 is an ILE program.
|
||
Since program CLPGM2 is ILE, it can consist of several procedures, such as:
|
||
CLPROC1, CLPROC2, CLPROC3, and CLPROC4. At runtime the following calls take
|
||
place: </p>
|
||
<ul><li>CLPGM1 is called first.</li>
|
||
<li>CLPGM1 calls CLPGM2.</li>
|
||
<li>CLPGM2 calls CLPROC1.</li>
|
||
<li>CLPROC1 calls CLPROC2.</li>
|
||
<li>CLPROC2 calls CLPROC3 or CLPROC4.</li>
|
||
</ul>
|
||
<div class="p">This figure below illustrates the following considerations:<ul><li>There is a one-to-one correspondence between a call stack entry and an
|
||
OPM program; for each call of an OPM program, one new entry is added to the
|
||
call stack.</li>
|
||
<li>An ILE program, as a unit, is not represented on the stack; instead, when
|
||
an ILE program is called, one entry is added to the stack for each procedure
|
||
that is called in the program. As a result, you send a message to an ILE procedure,
|
||
not to an ILE program.</li>
|
||
</ul>
|
||
</div>
|
||
<div class="note"><span class="notetitle">Note:</span> The first procedure to run when an ILE program is called is
|
||
the Program Entry Procedure (PEP) for the program. In CL, this procedure (_CL_PEP)
|
||
is generated by the system and calls the first procedure you provide. In this
|
||
example, the entry for the PEP is between the entry for the OPM program CLPGM1
|
||
and the entry for the procedure CLPROC1.</div>
|
||
<div class="fignone" id="callid__sndfig1"><a name="callid__sndfig1"><!-- --></a><span class="figcap">Figure 1. Example
|
||
of runtime call stack with an OPM program and an ILE program with multiple
|
||
procedures</span><br /><img src="rbafn563.gif" alt="" /><br /></div>
|
||
</div>
|
||
</div>
|
||
<div>
|
||
<ul class="ullinks">
|
||
<li class="ulchildlink"><strong><a href="callcmdbase.htm">Use the command as a base</a></strong><br />
|
||
To use the program or procedure that runs the <span class="cmdname">Send Program
|
||
Message (SNDPGMMSG)</span> command as the base call stack entry, you can
|
||
use the TOPGMQ parameter.</li>
|
||
<li class="ulchildlink"><strong><a href="callidbyname.htm">Identify the base entry by name</a></strong><br />
|
||
You can identify the base call stack entry by providing the name of the OPM program or ILE procedure running in that entry.</li>
|
||
<li class="ulchildlink"><strong><a href="callpgmasbase.htm">Use the program boundary as a base</a></strong><br />
|
||
You can specify the program boundary as the base call stack entry by using the *PGMBDY special value.</li>
|
||
<li class="ulchildlink"><strong><a href="callrecentasbase.htm">Use the most recently called procedure as a base</a></strong><br />
|
||
You can specify the most recently called procedure as the base call stack entry by using the *PGMNAME special value.</li>
|
||
<li class="ulchildlink"><strong><a href="callcontrolasbase.htm">Use a control boundary as a base</a></strong><br />
|
||
You can identify the base call stack entry as the one at the nearest control boundary by using the special value *CTLBDY.</li>
|
||
<li class="ulchildlink"><strong><a href="callservicepgms.htm">Considerations for service programs</a></strong><br />
|
||
This topic describes differences between ILE programs and ILE service programs.</li>
|
||
</ul>
|
||
|
||
<div class="familylinks">
|
||
<div class="parentlink"><strong>Parent topic:</strong> <a href="msgcl.htm" title="Various message types are described in this topic. Use the Send Program Message (SNDPGMMSG) command or the Send User Message (SNDUSRMSG) command to send a message from a CL procedure or program.">Send messages from a CL program</a></div>
|
||
</div>
|
||
<div class="relconcepts"><strong>Related concepts</strong><br />
|
||
<div><a href="msgcallqueue.htm" title="A call message queue is used to send messages between one program or procedure and another program or procedure.">Call message queue</a></div>
|
||
<div><a href="callcmdbase.htm" title="To use the program or procedure that runs the Send Program Message (SNDPGMMSG) command as the base call stack entry, you can use the TOPGMQ parameter.">Use the command as a base</a></div>
|
||
</div>
|
||
</div>
|
||
</body>
|
||
</html> |