A label may have control statements or commands following it; for
example:
-HERE&CONTINUE which indicates that the processing is to continue with the next line,
or:
-END&EXIT The &EXIT control statement indicates that the EXEC processor should
terminate execution of theEXEC and return contrel to CMS. You can also
specify a return code on the&EXIT control statement: &EXIT 6
results in a"(00006)" following the "Rn in the CMS ready message. If
you invoke aCMS command from the EXEC, you can specify that the return
code from theCMS command be used: &EXIT &RETCODE Since the &RETCODE special variable is set after each CMS command that
isexecuted r you can test it after any command to decide whether you
want execution to end. For example, you could use the&IP control
state.ent to test it:SIF &RETCODE NE 0 SEXIT SRETCODE "&EXIT &RETCODE" places the value of the CMS return code in the CMS ready message. You could place a line similar to the above following
each of yourCMS command lines, or you could use the SERROR control statement
r that will cause an exit as soon as an error is encountered: SERROR &EXIT &RETCODE
or you could use the&ERROR control statement to transfer control to
some other part of yourEXEC: SERROR &GOTO -CHECK
-CHECK
Another way to transfer control to another line is to use the&SKIP control statement: &SKIP 10 transfers control to a line that is 10 lines below the &SKIP line. You can transfer control above the current line as well:
&IF&X NE &Y &SKIP -3
Transferring control with&SKIP is faster, when an EXEC is executing,
than it is with&GOTO
r but modifying your EXEC files becomes more
difficult, particularly when you add or delete many lines.104 IBM VM/370 eMS User's Guide
example:
-HERE
or:
-END
terminate execution of the
specify a return code on the
results in a
you invoke a
code from the
is
want execution to end. For example, you could use the
state.ent to test it:
each of your
r
or you could use the
some other part of your
-CHECK
Another way to transfer control to another line is to use the
&IF
Transferring control with
than it is with
r
difficult, particularly when you add or delete many lines.