EXEC Control Statements-tREAD, &SKIP .-- I I &RErtD I I I I L- n 1 rtRGS r I n , 1 IrtRGS IVrtRS [&varl [&var2 ••• L
, I I I [&varn]]] , .J
reads the next n lines from the terminal and treats them as if
they had been in the EXEC file. Reading from the terminal
stops when n lines have been read, or when an &LOOP statement
or a statement that transfers control is encountered. If an
&READ statement is encountered, tne number of lines to be read by it is added to the number outstanding.
If n is not specified, the default 1 is assumed, and the EXEC continues processing after reading a single line.
reads a single line, assigns the entered tokens to the special
variables & 1, &2, ••• , &n, and resets the speci al variables &INDEt, &*, and &$.
If any of the tokens is specified as a percent sign (%) or
begins with the character X'FF', the corresponding argument is
set to blanks. VrtRS [&varl (&var2 ••• [&varn)]]
reads a single line and assigns the tokens entered to the
variable symbols &varl, &var2, ••• , &varn (up to 11). These variables are scanned in the same way as though they
appeared on the left-hand side of an assignment statement. If
no variable names are specified, any data read from the
terminal is lost.
If any of the tokens is specified as a percent sign (%) or
begins with the character X'FF', the corresponding variable is
set to blanks.
You can test the special variable &READFLAG to determine whether the
next &RErtD statement will result in a physical read to your terminal
(the value of &RErtDFLrtG is CONSOLE) or in reading a line from the
console stack (the value of &READFLAG is STrtCK). &SKIP Use the &SKIP control statement to cause a specified number of lines in
the EXEC file to be skipped. The format of the &SKIP control statement
is: r I r , , &SKIP , n I , , 1 I , L -' L- --I 292 IBM VM/370 CMS Command and Macro Reference
EXEC Subcommands-&SKIP, &SPACE n specifies the number of lines to be skipped: If n is greater than 0, the specified number of lines are
skipped. Execution continues on the line following the skipped
lines. If the value of n surpasses the number of lines
remaining in the file, the EXEC terminates processing. If n is equal to 0, no lines are skipped, and execution
continues with the next line. If n is less than 0, execution continues with the line that is n
lines above the current line: An attempt to sKip beyond the
beginning of the file results in an error exit from the EXEC. The n may be coded as a variable symbol. 1 is the default value
that is used when no value is specified for n. To pass control to a particular label in an EXEC procedure, use the &GOTO control statement. The &GOTO control statement provides more
flexibility when you want to update your EXEC procedures. The &SKIP statement, however, is more efficient, in terms of execution time.
&SPACE Use the &SP!CE control statement to display a specified number of blank
lines at your terminal. The format of the &SPACE control statement LS: ,------ I I &SPACE I I L- __
n specifies
r , I n I 1
the nu mb er of
If no number
blank lines
is specified,
to be &SPACE displayed at
1 is assumed
1. You may want to use the &SPACE control statement to control the
format of the execution summary that displays while your EXEC executes. Section 5. EXEC Control Statements 293
Previous Page Next Page