DOING I/O WITH AN EXEC You can communicate with your terminal using the &TYPE and &READ control
statements. Use &TYPE to display a line at your terminal: &TYPE &1 When this line is processed, if the variable &1 has a value of PROG1, the line is displayed as: PROG1 ASSEMBLE Use the &READ control statement when you want to be able to enter
data, variables, or control statements into your EXEC file while it is
executing. If you use it with an &TYPE statement, for example: &TYPE DO YOU WANT TO CONTINUE ?
&READ VARS &ANS you could test the variable &ANS in your EXEC to find out how processing
is to continue.
The &BEGTYPE control statement can be followed by a sequence of lines
you want to be displayed at the terminal. For example, if you want to
display ten lines of data, instead of using ten &TYPE control
statements, you could use: &BEGTYPE line1
line2
line10
&END
The &END control statement indicates the end of the lines to be typed. You can also use the &BEGTYPE control statement wben you want to type a
line that contains a word with more than eight characters in it; for
example: &BEGTYPE TODAY IS WEDNESDAY &END
The EXEC interpreter, however, does not perform substitutions on lines
entered this way. The lines:
&A = DOG &BEGTYPE MY &A IS NAMED FIDDLEFADDLE
&END
result in the display: &A IS FIDDLEFADDLE You must use the &TYPE statement when you want to display variable data;
you must use the &BEGTYPE control statement to display words with more
than eight characters.
To type null or blank lines at your terminal (to make output readable, for example), you can use the &SPACE control statement: &SPACE 5 106 IBM VM/370 eMS User's Guide
You can punch lines of tokens into your virtual card punch with the &PUNCH control statement: &PUNCH &NAME &TOTAL When you want to punch more than one line of data, or a line that
contains a word of more than eight characters in it, you should use the &BEGPUNCH control statement preceding the lines you want to punch, and
follow them with an &END The EXEC processor does net
interpret these lines, however, so any variable symbols you enter on
these lines are not substituted. When you punch lines from an EXEC procedure what you
doing is creating a file in your virtual card punch. To
file for processing, you must close the punch:
cp close punch
are actually
release the
The destination of the file depends on how you have spooled your punch.
If you have spooled it to yourself, the file is placed in your virtual
card reader, and you can read it onto a virtual disk using the READCARD
command.
The EXEC control statements &STACK and &BEGSTACK allow you to stack
lines in your terminal console, to be executed as soon as a read occurs
in your virtual machine. Stacking is useful when you use commands that
require responses, for example, the SORT command:
&STACK 1 20 SORT INFILE FILE A OUTFILE FILE A When the SORT command is executed; a prompting message is issued, the
virtual machine read occurs, and the response that you have stacked is
read. If you do not stack a response to this command, your EXEC does
not continue processing until you enter the response from your terminal.
In the above example of the SORT command, you can suppress the
prompting message by issuing the &STACK HT command immediately before
the SORT command. Restore normal terminal operations by placing an
&STACK RT command after the SORT command.
Stacking is useful in creating edit macros or in editing files from EXEC procedures. MONITORING EXEC PROCEDURES Two EXEC control statements, &CONTROL and &TIME, centrol how much
information is displayed at your terminal while your EXEC file is
executing. This display is called an execution summary.
Since you do not usually receive a CMS ready message after the
execution of each CMS command in an EXEC, you do not receive the timing
Section 6. Introduction to the EXEC Processor 107
Previous Page Next Page