Branches to another statement within the procedure.
&GOTO .label [ .limlabel [ EQ | NE | GT| LT| GE | LE ] ]
The &GOTO verb lets you change the current processing location within a procedure-control transfers to the statement beginning with the specified target label.
After variable substitution, the label must begin with a period and is from 1 to 12 characters long (not including the period).
The target label can precede or follow the statement containing the &GOTO.
Note: Where possible, using &DO, &DOWHILE, and &DOUNTIL to construct do-loops is preferable to using &IF ... &GOTO logic.
Operands:
A label within the procedure.
A label in the procedure that delimits the extent of the search for .label. If .limlabel is found before the required label .label is located, the search terminates with a 'label not found' condition. Use .limlabel to improve the performance of procedures where a large number of unexpected labels normally discarded by the &CONTROL NOLABEL facility are received. When used with the search scope (see next operand), .limlabel can assist with table processing.
An optional search scope used to qualify the selection of a target label that satisfies the search for .label up to the range set by .limlabel. If this operand is required, then .limlabel must be specified. In cases where .limlabel is not required enter it with the same value as .label. In both cases the operator must be separated from the value being tested with a space .
If this operand is omitted, .limlabel must exactly equal a procedure label to terminate the search.
Specifies that the first label generically equal to .label will satisfy the search.
Specifies that the first label generically not equal to .label will satisfy the search.
Specifies that the first label greater than .label will satisfy the search.
Specifies that the first label less than .label will satisfy the search.
Specifies that the first label greater than or equal to .label will satisfy the search.
Specifies that the first label less than or equal to .label will satisfy the search.
Examples: &GOTO
Notes: More examples are supplied in the system distribution library.
& CONTROL NOLABEL
&GOTO .&1 -* YES and NO are only valid options
-* Control returns here if label .&1 is
-* undefined.
&ENDAFTER &WRITE ALARM=YES DATA='YES' OR 'NO' MUST BE +
ENTERED
.YES
-*
-* NCL statements
-*
.NO
-*
-* NCL statements
-*
.LOOP
&INTREAD ARGS
&GOTO .&1 .ENDTABLE -* .ENDTABLE is LIMLABEL
&GOTO .LOOP -* Skip the message if label
-* not found
.IST970I
.IST355I
&GOTO .LOOP -* Process the next message
.IST346I
-*
-* Processing logic for IST346I
-*
&GOTO .LOOP -* Process the next message
.ENDTABLE -* Defines end of table
Notes:
| Copyright © 2009 CA. All rights reserved. |
|