86 lines
2.8 KiB
HTML
86 lines
2.8 KiB
HTML
|
|
<!doctype html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<html>
|
|
<head><META http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
<title>End Do Group (ENDDO)</title>
|
|
<link rel="stylesheet" type="text/css" href="../rzahg/ic.css">
|
|
</head>
|
|
<body bgcolor="white">
|
|
<script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
|
<a name="ENDDO.Top_Of_Page"></a>
|
|
<h2>End Do Group (ENDDO)</h2>
|
|
<table width="100%">
|
|
<tr>
|
|
<td valign="top" align="left"><b>Where allowed to run: </b>
|
|
<ul><li>Batch program (*BPGM)</li>
|
|
<li>Interactive program (*IPGM)</li>
|
|
</ul><b>Threadsafe: </b>Yes
|
|
</td>
|
|
<td valign="top" align="right">
|
|
<a href="#ENDDO.PARAMETERS.TABLE">Parameters</a><br>
|
|
<a href="#ENDDO.COMMAND.EXAMPLES">Examples</a><br>
|
|
<a href="#ENDDO.ERROR.MESSAGES">Error messages</a></td>
|
|
</tr>
|
|
</table>
|
|
|
|
<div> <a name="ENDDO"></a>
|
|
<p>The End Do (ENDDO) command is used with the DO command to identify a group of commands that are processed together as a group. The ENDDO command specifies the end of the Do group that is started with an associated DO command. The ENDDO command must be specified after the last command in the Do group.
|
|
</p>
|
|
<p>When Do groups are nested, each group must have its own ENDDO command at its end. Every ENDDO command must be associated with a DO command; if too many ENDDO commands occur in the CL procedure source, a message is issued and the program is not created.
|
|
</p>
|
|
<p><b>Restrictions:</b> This command is valid only within a CL procedure.
|
|
</p>
|
|
<p>There are no parameters for this command.
|
|
</p>
|
|
</div>
|
|
<table width="100%">
|
|
<tr><td align="right"><a href="#ENDDO.Top_Of_Page">Top</a></td></tr>
|
|
</table>
|
|
<hr size="2" width="100%">
|
|
|
|
<div>
|
|
<h3><a name="ENDDO.PARAMETERS.TABLE">Parameters</a></h3>None<br>
|
|
|
|
<table width="100%">
|
|
<tr><td align="right"><a href="#ENDDO.Top_Of_Page">Top</a></td></tr>
|
|
</table>
|
|
</div>
|
|
<hr size="2" width="100%">
|
|
<div><h3><a name="ENDDO.COMMAND.EXAMPLES">Examples</a> </h3>
|
|
<p><b>Example 1: Processing a Group of Commands Unconditionally</b>
|
|
</p>
|
|
<p>
|
|
<pre>
|
|
DO
|
|
: (group of CL commands)
|
|
ENDDO
|
|
</pre>
|
|
</p>
|
|
<p>The commands between the DO and ENDDO commands are processed once, as a group of commands.
|
|
</p>
|
|
<p><b>Example 2: Processing a Group of Commands Conditionally</b>
|
|
</p>
|
|
<p>
|
|
<pre>
|
|
IF &SWITCH DO
|
|
: (group of CL commands)
|
|
ENDDO
|
|
</pre>
|
|
</p>
|
|
<p>The commands between the DO and ENDDO commands are processed if the value in the logical variable &SWITCH is '1'. If &SWITCH is not '1', then control passes immediately to the next command following the ENDDO command.
|
|
</p>
|
|
</div>
|
|
<table width="100%">
|
|
<tr><td align="right"><a href="#ENDDO.Top_Of_Page">Top</a></td></tr>
|
|
</table>
|
|
<hr size="2" width="100%">
|
|
<div><h3><a name="ENDDO.ERROR.MESSAGES">Error messages</a> </h3>
|
|
<p>None
|
|
</p>
|
|
</div>
|
|
<table width="100%">
|
|
<tr><td align="right"><a href="#ENDDO.Top_Of_Page">Top</a></td></tr>
|
|
</table>
|
|
</body>
|
|
</html>
|