79 lines
4.1 KiB
HTML
79 lines
4.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="reference" />
|
||
|
<meta name="DC.Title" content="GOTO command and labels" />
|
||
|
<meta name="abstract" content="The GOTO command processes an unconditional branch." />
|
||
|
<meta name="description" content="The GOTO command processes an unconditional branch." />
|
||
|
<meta name="DC.subject" content="GOTO (Go To) command, command, CL, GOTO (Go To), label, in CL procedure, example, GOTO command" />
|
||
|
<meta name="keywords" content="GOTO (Go To) command, command, CL, GOTO (Go To), label, in CL procedure, example, GOTO command" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="contp.htm" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="../clfinder/finder.htm" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="../cl/goto.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="gotoc" />
|
||
|
<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>GOTO command and labels</title>
|
||
|
</head>
|
||
|
<body id="gotoc"><a name="gotoc"><!-- --></a>
|
||
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
||
|
<h1 class="topictitle1">GOTO command and labels</h1>
|
||
|
<div><p>The GOTO command processes an unconditional branch.</p>
|
||
|
<div class="section"><p>With the GOTO command, processing is directed to another part
|
||
|
(identified by a label) of the procedure whenever the GOTO command is encountered.
|
||
|
This branching does not depend on the evaluation of an expression. After
|
||
|
the branch to the labeled statement, processing begins at that statement and
|
||
|
continues in consecutive sequence; it does not return to the GOTO command
|
||
|
unless specifically directed back by another instruction. You
|
||
|
can branch forward or backward. You cannot use GOTO to go to a label outside
|
||
|
the procedure, nor can you use a GOTO to branch into or out of a subroutine
|
||
|
defined within the procedure. The GOTO command has one parameter, which contains
|
||
|
the label of the statement branched to: </p>
|
||
|
<pre>GOTO CMDLBL(label)</pre>
|
||
|
<p>A label identifies the statement in the procedure to which
|
||
|
processing is directed by the GOTO command. To use a GOTO command, the command
|
||
|
you are branching to must have a label. </p>
|
||
|
<pre> PGM
|
||
|
.
|
||
|
.
|
||
|
.
|
||
|
START: SNDRCVF RCDFMT(MENU)
|
||
|
IF (&RESP=1) THEN(CALL CUS210)
|
||
|
.
|
||
|
.
|
||
|
.
|
||
|
GOTO START
|
||
|
.
|
||
|
.
|
||
|
.
|
||
|
ENDPGM</pre>
|
||
|
<p>The label in this example is START. A label can have as many
|
||
|
as 10 characters and must be immediately followed by a colon, but blanks can
|
||
|
occur between the label and the command name.</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="relinfo"><strong>Related information</strong><br />
|
||
|
<div><a href="../clfinder/finder.htm">CL command finder</a></div>
|
||
|
<div><a href="../cl/goto.htm">Go To (GOTO) command</a></div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</body>
|
||
|
</html>
|