&BLANK = &TYPE &LOOP 3 &X HE All of the above are valid EXEC control statements.
11. EXEC executes the statement. If no error is
passes to the next logical statement. If an EXEC processing. 310 IBM VM/370 CMS User's Guide
encountered, control
error is encountered,
Section 17. Writing Edit Macros
If you have a good knowledge of the CMS EXEC facilities and an
understanding of the CMS editor, you may wish to write edit macros. An
edit macro is simply an EXEC file that contains a sequence of EDIT
subcommands. Edit macros can only be invoked frem the edit environment.
An edit macro may contain a simple sequence of EDIT subcommands, or its
execution may be dependent on arguments you enter when you invoke it.
This section provides information on creating edit macros, suggestions
on how to manipulate the console stack, and some examples of macros that
you can create and use.
Creating Edit Macro Files An edit macro must have a filename
a filetype of EXEC. Rules for
substitution are the same as for all
contain: BDIT subcommands EXEC control statements
beginning with a dollar sign ($) and
file format, scanning and token
other EXEC files. A macro file may CMS commands that are valid in CMS subset When you create an edit macro that accepts arguments, you should be
sure to check the validity of the arguments, and issue appropriate error
messages. If you are writing an edit macro to expect arguments, you must
keep in mind that the macro command line is scanned, and that any data
items you enter are padded or truncated into eight-character tokens.
Tokens are always translated to uppercase letters. You should annotate all of your macro files, and provide a response
to a question mark (1) entered as the sole argument (as described under
"Annotating EXEC Procedures" in "Section 16. Refining Your EXEC Procedures"). How Edit Macros Work Since an edit macro is an EXEC file, it is actually executed by the EXEC interpreter, and not by the editor. The EXEC interpreter can only
execute EXEC control statements and CMS commands. The only way to issue
an EDIT subcommand from an EXEC file is to stack the subcommand in the
console stack, so that when the editor is invoked, or receives control,
it reads the subcommand(s) from the console stack before accepting input
lines from the terminal. For example: &STACK CASE M &STACK RECF!! V EDIT &1 CHART A1 When the EDIT command is invoked from this EXEC, the editor reads the
subcoamands from the stack and executes thea. To execute these same subcommands from an edit macro file, you must
use the same technique; that is, you must place the subcommands·in the
console stack, for example: section 17. Writing Edit Macros 311
Previous Page Next Page