298 eMS User's Guide
Section 15. Using EXECs with CMS Commands Whenever you create an EXEC file you are, for all practical purposes,
creating a new CMS command. When you enter a command line in the CMS environment, CMS searches for an EXEC file with the specified filename before searching for a MODULE file or CMS command. You can place the names of your EXEC files in a synonym table and assign minimum truncation values for the synonyms, just as you can for CMS command
names. While many of your EXEC procedures may be very simple, others may be
very long and complicated, and perform many of the housekeeping
functions performed by CMS co.mands, such as syntax checking, error
message generation, and so on.
Monitoring CMS Command Execution Many, or most, of your EXEC procedures may contain sequences of CMS commands that you want to execute. If your EXEC procedure contains no EXEC control statements, each command line is displayed and then the
command is executed: Tf error occurred; the eMS error message is
displayed, followed by a return code in the format: +++ R(nnnnn) •• + where nnnnn is the nonzero return code from the eMS command. If the
command is not a valid CMS command, or the command function for SET or QUERY is invalid and the implicit CP function is in effect, the return
code is a -3:
+++ R(-0003) +++ You may also receive this error return when you use a CP command without
prefacing it with the CP command. If you enter an unknown CP command
following "CP", you receive a return code of 1.
If a command completes successfully, no return code is displayed.
If you do not want to see the command lines displayed before
execution, nor return codes following execution, you can use the EXEC control statement: &COBTROL OFF Or, if you want to see only the command lines that produced errors, and
the resultant return codes, you can specify: &CONTROL ERROR Regardless of these settings of the &CONTROL statement, CMS error messages are displayed, as long as the value of &READFLAG is RT, and the
terminal is displaying output.
If you issue the LISTFILE, STATE, ERASE, or RENAME commands in an EXEC procedure, and you do not want to see the error message FILE NOT FOUND displayed, you can use the statement: &CONTROL NOMSG to suppress the display of these particular messages.
Section 15. Using EXECs with CMS Commands 299
Previous Page Next Page