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

154 lines
11 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="reference" />
<meta name="DC.Title" content="Control processing within a CL procedure" />
<meta name="abstract" content="You can use commands to change the flow of logic within your CL procedure." />
<meta name="description" content="You can use commands to change the flow of logic within your CL procedure." />
<meta name="DC.subject" content="CL procedure, controlling processing, controlling, processing in CL procedure, processing, within CL procedure, logic flow in CL procedure, conditional processing of command, branching, unconditional, unconditional branching" />
<meta name="keywords" content="CL procedure, controlling processing, controlling, processing in CL procedure, processing, within CL procedure, logic flow in CL procedure, conditional processing of command, branching, unconditional, unconditional branching" />
<meta name="DC.Relation" scheme="URI" content="clpro.htm" />
<meta name="DC.Relation" scheme="URI" content="gotoc.htm" />
<meta name="DC.Relation" scheme="URI" content="ifcmd.htm" />
<meta name="DC.Relation" scheme="URI" content="elsec.htm" />
<meta name="DC.Relation" scheme="URI" content="embif.htm" />
<meta name="DC.Relation" scheme="URI" content="docmd.htm" />
<meta name="DC.Relation" scheme="URI" content="dountilcmd.htm" />
<meta name="DC.Relation" scheme="URI" content="dowhilecmd.htm" />
<meta name="DC.Relation" scheme="URI" content="doforcmd.htm" />
<meta name="DC.Relation" scheme="URI" content="iteratecmd.htm" />
<meta name="DC.Relation" scheme="URI" content="leavecmd.htm" />
<meta name="DC.Relation" scheme="URI" content="callsubrc.htm" />
<meta name="DC.Relation" scheme="URI" content="selectcmd.htm" />
<meta name="DC.Relation" scheme="URI" content="subrc.htm" />
<meta name="DC.Relation" scheme="URI" content="expr.htm" />
<meta name="DC.Relation" scheme="URI" content="rbam6addr.htm" />
<meta name="DC.Relation" scheme="URI" content="binar.htm" />
<meta name="DC.Relation" scheme="URI" content="rbam6offset.htm" />
<meta name="DC.Relation" scheme="URI" content="subst.htm" />
<meta name="DC.Relation" scheme="URI" content="switc.htm" />
<meta name="DC.Relation" scheme="URI" content="monms.htm" />
<meta name="DC.Relation" scheme="URI" content="workv.htm" />
<meta name="DC.Relation" scheme="URI" content="../clfinder/finder.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="contp" />
<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>Control processing within a CL procedure</title>
</head>
<body id="contp"><a name="contp"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">Control processing within a CL procedure</h1>
<div><p>You can use commands to change the flow of logic within your CL
procedure.</p>
<div class="section"><p>Commands in a CL procedure are processed in consecutive sequence.
Each command is processed, one after another, in the sequence in which it
is encountered. You can alter this consecutive processing using commands
that change the flow of logic in the procedure. These commands can be conditional
or unconditional.</p>
<p>Unconditional branching means that you can instruct
processing to branch to commands or sets of commands located anywhere in the
procedure without regard to what conditions exist at the time the branch instruction
is processed. Unconditional processing commands include: </p>
<ul><li>GOTO</li>
<li>ITERATE</li>
<li>LEAVE</li>
<li>CALLSUBR</li>
</ul>
<p>Conditional branching means that under certain specified conditions,
processing may branch to sections or commands that are not consecutive within
the procedure. The branching may be to any statement in the procedure. This
is called conditional processing because the branching only occurs
when the specified condition is true. Conditional processing is usually associated
with the IF command. With the ELSE command, you can specify alternative processing
if the condition is not true.The simple DO command allows you to create groups
of commands that are always processed together, as a group, under specified
conditions. Conditional processing commands include: </p>
<ul><li>IF and THEN</li>
<li>SELECT, WHEN, and OTHERWISE</li>
<li>DOFOR</li>
<li>DOWHILE</li>
<li>DOUNTIL</li>
</ul>
</div>
</div>
<div>
<ul class="ullinks">
<li class="ulchildlink"><strong><a href="gotoc.htm">GOTO command and labels</a></strong><br />
The GOTO command processes an unconditional branch.</li>
<li class="ulchildlink"><strong><a href="ifcmd.htm">IF command</a></strong><br />
The IF command is used to state a condition that, if true, specifies some statement or group of statements in the procedure to be run.</li>
<li class="ulchildlink"><strong><a href="elsec.htm">ELSE command</a></strong><br />
The ELSE command is a way of specifying alternative processing if the condition on the associated IF command is false.</li>
<li class="ulchildlink"><strong><a href="embif.htm">Embedded IF commands</a></strong><br />
An IF command can be embedded in another IF command.</li>
<li class="ulchildlink"><strong><a href="docmd.htm">DO command and DO groups</a></strong><br />
The DO command allows you to process a group of commands together.</li>
<li class="ulchildlink"><strong><a href="dountilcmd.htm">DOUNTIL command</a></strong><br />
The Do Until (DOUNTIL) command processes a group of CL commands one or more times.</li>
<li class="ulchildlink"><strong><a href="dowhilecmd.htm">DOWHILE command</a></strong><br />
The DOWHILE command lets you process a group of commands zero or more times while the value of a logical expression is true.</li>
<li class="ulchildlink"><strong><a href="doforcmd.htm">DOFOR command</a></strong><br />
The DOFOR command lets you process a group of commands a specified number of times.</li>
<li class="ulchildlink"><strong><a href="iteratecmd.htm">ITERATE command</a></strong><br />
The <span class="cmdname">Iterate (ITERATE)</span> command can be used to
skip the remaining commands in an active DOWHILE, DOUNTIL, or DOFOR group. </li>
<li class="ulchildlink"><strong><a href="leavecmd.htm">LEAVE command</a></strong><br />
The <span class="cmdname">Leave (LEAVE)</span> command can be used to exit
an active DOWHILE, DOUNTIL, or DOFOR group. </li>
<li class="ulchildlink"><strong><a href="callsubrc.htm">CALLSUBR command</a></strong><br />
The <span class="cmdname">Call Subroutine (CALLSUBR)</span> command is used
in a CL procedure for passing control to a subroutine defined within the same
procedure.</li>
<li class="ulchildlink"><strong><a href="selectcmd.htm">SELECT command and SELECT groups</a></strong><br />
The <span class="cmdname">Select (SELECT)</span> command is used to identify
one or more conditions and an associated group of commands to process when
that condition is true. </li>
<li class="ulchildlink"><strong><a href="subrc.htm">SUBR command and Subroutines</a></strong><br />
The <span class="cmdname">Subroutine (SUBR)</span> command is used in a CL
procedure, along with the <span class="cmdname">End Subroutine (ENDSUBR)</span> command,
to delimit the group of commands that define a subroutine. </li>
<li class="ulchildlink"><strong><a href="expr.htm">*AND, *OR, and *NOT operators</a></strong><br />
The logical operators *AND and *OR specify the relationship between operands in a logical expression. The logical operator *NOT is used to negate logical variables or constants.</li>
<li class="ulchildlink"><strong><a href="rbam6addr.htm">%ADDRESS built-in function</a></strong><br />
The address built-in function (%ADDRESS or %ADDR) can be used to change or test the memory address stored in a CL pointer variable and can only be used within a CL procedure.</li>
<li class="ulchildlink"><strong><a href="binar.htm">%BINARY built-in function</a></strong><br />
The binary built-in function (%BINARY or %BIN) interprets the contents of a specified CL character variable as a signed binary integer.</li>
<li class="ulchildlink"><strong><a href="rbam6offset.htm">%OFFSET built-in function</a></strong><br />
The offset built-in function (%OFFSET or %OFS) can be used to store or change the offset portion of a CL pointer variable and can only be used within a CL procedure.</li>
<li class="ulchildlink"><strong><a href="subst.htm">%SUBSTRING built-in function</a></strong><br />
The substring built-in function (%SUBSTRING or%SST) produces a character string that is a subset of an existing character string and can only be used within a CL procedure.</li>
<li class="ulchildlink"><strong><a href="switc.htm">%SWITCH built-in function</a></strong><br />
The switch built-in function (%SWITCH) compares one or more of eight switches with the eight switch settings already established for the job and returns a logical value of '0' or '1'.</li>
<li class="ulchildlink"><strong><a href="monms.htm">Monitor Message (MONMSG) Command</a></strong><br />
The <span class="cmdname">Monitor Message (MONMSG)</span> command is used
to monitor for escape, notify, or status messages sent to the call stack of
the procedure in which the <span class="cmdname">Monitor Message (MONMSG)</span> command
is used. </li>
</ul>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="clpro.htm" title="This provides tasks and concepts specific to CL programming.">CL programming</a></div>
</div>
<div class="reltasks"><strong>Related tasks</strong><br />
<div><a href="workv.htm" title="CL procedures consist of CL commands, and the commands themselves consist of the command statement, parameters, and parameter values.">Use variables</a></div>
</div>
<div class="relinfo"><strong>Related information</strong><br />
<div><a href="../clfinder/finder.htm">CL command finder</a></div>
</div>
</div>
</body>
</html>