&IF &INDEX = 0 &GOTO -HELP &IF &INDEX = 1 &IF &1 = ? &GOTO -TELL &EXIT -HELP &BEGTYPE &END &EXIT CORRECT FORM IS • COpy OLDFN OLDFT NEWFN • TYPE • COpy ? • FOR MORE INFO -TELL &BEGTYPE &END &EXIT CORRECT FORM IS • COPY OLDFN OLDFT NEWFN • USES COPYFILE COMMAND TO CHANGE ONLY THE FILENAME This type of annotating is especially useful if you share your disks or
yourEXECs with other users.
Error Situations
It is good practice, when writingEXECs, to anticipate error situations
and to provide meaningful error or information messages to describe the
error when it occurs. The following error situations, and suggestions
for handling them, have already been discussed:• Errors in invoking the EXEC, either
arguments, or with invalid arguments.
14. BuildingEXEC procedures.")
with an improper number of(See "Arguments" in "Section • Errors in CMS command processing that can be detected with an &ERROR control statement or with the &RETCODE special variable. (See "Handling Error Returns from CMS Commands" in "Section 15. Using EXECs With CMS Commands.") Many different kinds of errors may also occur, in the processing of
yourEXEC control statements. EXEC processing errors, such as an attempt
to branch to a nonexistent label or an invalid syntax, are
"unrecoverable" errors. These errors always terminateEXEC processing
and return your virtual machine to theCMS environment or to the calling EXEC procedure or program. The error messages produced by EXEC, and the
associated return codes, are described in theWRITING ERROR MESSAGES One way to make your EXECs more readable, especially if they are long EXECs, is to group all of your error messages in one place, probably at
the end of theEXEC file. You may also wish to number your messages and
associate the message number with a label number and a return code. For
example:306 IBM VM/310 eMS User's Guide
your
Error Situations
It is good practice, when writing
and to provide meaningful error or information messages to describe the
error when it occurs. The following error situations, and suggestions
for handling them, have already been discussed:
arguments, or with invalid arguments.
14. Building
with an improper number of
your
to branch to a nonexistent label or an invalid syntax, are
"unrecoverable" errors. These errors always terminate
and return your virtual machine to the
associated return codes, are described in the
the end of the
associate the message number with a label number and a return code. For
example: