80 lines
5.4 KiB
HTML
80 lines
5.4 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="reference" />
|
|
<meta name="DC.Title" content="DO command and DO groups" />
|
|
<meta name="abstract" content="The DO command allows you to process a group of commands together." />
|
|
<meta name="description" content="The DO command allows you to process a group of commands together." />
|
|
<meta name="DC.subject" content="DO (Do) command, command, CL, ENDDO (End Do) command, End Do (ENDDO) command, ENDDO (End Do), command, CL, End Do (ENDDO), DO (Do), example, DO command, ENDDO command, nested Do group, DO group" />
|
|
<meta name="keywords" content="DO (Do) command, command, CL, ENDDO (End Do) command, End Do (ENDDO) command, ENDDO (End Do), command, CL, End Do (ENDDO), DO (Do), example, DO command, ENDDO command, nested Do group, DO group" />
|
|
<meta name="DC.Relation" scheme="URI" content="contp.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="ifcmd.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="../clfinder/finder.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="../cl/do.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="docmd" />
|
|
<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>DO command and DO groups</title>
|
|
</head>
|
|
<body id="docmd"><a name="docmd"><!-- --></a>
|
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
|
<h1 class="topictitle1">DO command and DO groups</h1>
|
|
<div><p>The DO command allows you to process a group of commands together. </p>
|
|
<div class="section"><p>The group is defined as all those commands between the DO command
|
|
and the corresponding <span class="cmdname">End Do Group (ENDDO)</span> command.</p>
|
|
<p>Processing
|
|
of the group is usually conditioned on the evaluation of an associated
|
|
command. Do groups are most frequently associated with the IF, ELSE, or MONMSG
|
|
commands. For instance:</p>
|
|
<div class="fignone"><br /><img src="rv2w272.gif" alt="Processing of the group is usually conditioned on the evaluation of an associated command. Do groups are most frequently associated with the IF, ELSE, or MONMSG commands." /><br /></div>
|
|
<p>If the logical expression <samp class="codeph">(&A=&B)</samp> is true,
|
|
then the Do group is processed. If the expression is not true, then processing
|
|
starts after the ENDDO command; the Do group is skipped.</p>
|
|
<p>In the following
|
|
procedure, if &A is not equal to &B, the system calls PROCB. PROCA
|
|
is not called, nor are any other commands in the Do group processed.</p>
|
|
<div class="fignone"><br /><img src="rv3w198.gif" alt="In the following procedure, if &A is not equal to &B, the system calls PROCB. PROCA is not called, nor are any other commands in the Do group processed." /><br /></div>
|
|
<p>Do groups can be nested within other Do groups, up to a maximum of
|
|
25 levels of nesting.</p>
|
|
<p>There are three levels of nesting in the following
|
|
example. Note how each Do group is completed by an <span class="cmdname">End Do Group
|
|
(ENDDO)</span> command.</p>
|
|
<div class="fignone"><br /><img src="rv3w199.gif" alt="There are three levels of nesting in this following example. Note how each Do group is completed by an ENDDO command." /><br /></div>
|
|
<p>In this example, if &A in the first nest does not equal 5, PGMC
|
|
is called. If &A does equal 5, the statements in the second Do group
|
|
are processed. If &AREA in the second Do group does not equal YES, procedure
|
|
ACCTSPAY is called, because processing moves to the next command after the
|
|
Do group.</p>
|
|
<p>The CL compiler does not indicate the beginning or ending
|
|
of Do groups. If the CL compiler notes any unbalanced conditions, it is not
|
|
easy to detect the actual errors.</p>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="contp.htm" title="You can use commands to change the flow of logic within your CL procedure.">Control processing within a CL procedure</a></div>
|
|
</div>
|
|
<div class="relref"><strong>Related reference</strong><br />
|
|
<div><a href="ifcmd.htm" title="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.">IF command</a></div>
|
|
</div>
|
|
<div class="relinfo"><strong>Related information</strong><br />
|
|
<div><a href="../clfinder/finder.htm">CL command finder</a></div>
|
|
<div><a href="../cl/do.htm">Do Group (DO) command</a></div>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html> |