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

81 lines
5.6 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="Example: Use the Transfer Control (TFRCTL) command" />
<meta name="abstract" content="This is an example of transferring control to improve performance." />
<meta name="description" content="This is an example of transferring control to improve performance." />
<meta name="DC.Relation" scheme="URI" content="tfrct.htm" />
<meta name="DC.Relation" scheme="URI" content="passp.htm" />
<meta name="DC.Relation" scheme="URI" content="../cl/tfrctl.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="tfr" />
<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: Use the Transfer Control (TFRCTL) command</title>
</head>
<body id="tfr"><a name="tfr"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">Example: Use the Transfer Control (TFRCTL) command</h1>
<div><p>This is an example of transferring control to improve performance.</p>
<div class="section"> <p>In the following illustration, if Program A is specified with
USRPRF(*OWNER), the owner's authorities are in effect for all of the programs
shown. If Program B is specified with USRPRF(*OWNER), the owner's authorities
are in effect only while Programs B and C are active. When Program B transfers
control to Program D, Program B is no longer in the call stack and the owner
of Program B is no longer considered for authorization during the running
of Program D. When the programs complete processing (by returning or transferring
control), the owner's authorities are no longer in effect. Any overrides
issued by Program B remain in effect while Program D is running and are lost
when Program D does a return.<br /><img src="rbafn546.gif" alt="In this illustration, if Program A is specified with USRPRF(*OWNER), the owner's authorities are in effect for all of the programs shown. If Program B is specified with USRPRF(*OWNER), the owner's authorities are in effect only while Programs B and C are active. When Program B transfers control to Program D, Program B is no longer in the call stack and the owner of Program B is no longer considered for authorization during the running of Program D. When the programs complete processing (by returning or transferring control), the owner's authorities are no longer in effect. Any overrides issued by Program B remain in effect while Program D is running and are lost when Program D does a return." /><br /></p>
<p>The <span class="cmdname">Transfer
Control (TFRCTL)</span> command has the following format: </p>
<pre>TFRCTL PGM(library-name/program-name) PARM(CL-variable)</pre>
<p>The program (and library qualifier) may be a variable.</p>
<p>It
is important to note that only variables may be used as parameter arguments
on this command, and that those variables must have been received as a parameter
in the argument list from the program that called the transferring program.
That is, the <span class="cmdname">Transfer Control (TFRCTL)</span> command cannot
pass a variable that was not passed to the program running the <span class="cmdname">Transfer
Control (TFRCTL)</span> command.</p>
<p>In the following example, the first <span class="cmdname">Transfer
Control (TFRCTL)</span> is valid. The second <span class="cmdname">Transfer Control
(TFRCTL)</span> command is not valid because &amp;B was not passed to this
program. The third TFRCTL command is not valid because a constant cannot
be specified as an argument. </p>
<pre>PGM PARM(&amp;A)
DCL &amp;A *DEC 3
DCL &amp;B *CHAR 10
IF (&amp;A *GT 100) THEN (TFRCTL PGM(PGMA) PARM(&amp;A)) /* valid */
IF (&amp;A *GT 50) THEN (TFRCTL PGM(PGMB) PARM(&amp;B)) /* not valid */
ELSE (TFRCTL PGM(PGMC) PARM('1')) /* not valid */
ENDPGM</pre>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="tfrct.htm" title="The Transfer Control (TFRCTL) command calls the program specified on the command, passes control to it, and removes the transferring program from the call stack.">Transfer control to improve performance</a></div>
</div>
<div class="reltasks"><strong>Related tasks</strong><br />
<div><a href="passp.htm" title="When you pass control to another program or procedure, you can also pass information to it for modification or use within the receiving program or procedure.">Pass parameters</a></div>
</div>
<div class="relinfo"><strong>Related information</strong><br />
<div><a href="../cl/tfrctl.htm">Transfer Control (TFRCTL) command</a></div>
</div>
</div>
</body>
</html>