-ERRANAL
&CNT = 0 &LOOP 2 &CNT EQ 12
&IF &RETCODE EQ &CNT &GOTO -FIX&CNT &eNT = &CNT +- 1 -FIXO &GOTO -ALLOK -FIX1 &GOTO -ALLOK -FIX2 &GOTO -ALLOK -FIX 11 -ALLOK When the value of the &CNT variable equals the return code value in &RETCODE, the branch to the corresponding -FIX routine is taken. Each
corrective routine performs different actions, depending on its code,
and finishes at the routine labeled -ALLOK. You can, in some cases, determine the cause of a CMS command error
and attempt to correct it in your EXEC. To do this, you must know the
return codes issued by VM/310 co •• ands. See for a
discussion of the return codes for VM/310 commands. In addition, the
error messages and corresponding return codes are listed under the
command descriptions for each CMS command in the As an example, all CMS commands that search for files issue a return
code of 28 when a file is not found. If you want to test for a
file-not-found condition in your EXEC, you might use statements similar to the following: &CONTROL OFF NOMSG TYPE HELP MEMO A
&IF &RETCODE = 28 &GOTO -NOFILE Tailoring CMS Commands for Your Own Use You can create EXEC procedures that simplify or extend the use of a
particular CMS command. Depending on your applications, you can modify
the CMS command language to suit your needs. You can create EXEC files
that have the same names as CMS commands, and, since CMS locates EXEC files before MODULE files, the EXEC is found first. For example, the COPYFILE command, when used to copy eMS disk files, requires six operands. If you change only the filename when you copy files, you could
create a COpy EXEC as follows: 302 IBM VM/370 eMS User's Guide
Paqe of GC20-1819-2 As Updated April 1, 1981 by TNL GN25-0826 &CONTROL OFF &IF &INDEX 3 &SKIP 2 COPYFJLE &1 &2 a &3 &2 = &EXIT CO?YFILE &1 &2 &3 &4 &5 &6 &7 &8 &9 &10 &11 &12 &13 &14 &15
If you always invoke the COPYFILE command using the truncation COPY, EXEC the command line for you, if you have entered the
three arguments, EXEC formats the COPYFILE command for you. If other nlmber of arguments is entered, the COpy FILE command is invoked
with all the arguments as entered. CREArIN; YOUR OWP DEFAULT FILETYPES If you use special filetypes for particular and they not those that the eMS editor supplies default settinqs for, but
do require special editor settinqs, you can create an EXE: to invoke the
editor. The EXEC can check for particular filetypes, and if it finds
them, stack the appropriate EDIT subcommands. If you name this EXEC procedure E EYEC, then you can bypass it by using a longer form of the
EDIT command. The following is a sample E EXEC: &CONTROL OFF &IF GT 1 &SKIP 2
EDIT &1 SCRIPT &IF &2 EO TABLE &GOTO -TABLE &IP &2 EO CHART &GCTO -CHAFT
&IF &2 EQ EXEC &GCTO -EX &2 SISIN &GOTO -SISIN -NJRM EDIT &1 &2 &3 &4 &5 &6 &EXIT IMAGE ON TABS 1 10 20 CASE SEND EDIT &1 &2 &3 (LRECL 20 r.EXIT IMAGE ON SEND EDIT &1 &2 r.3 &EXIT -EX
EDIT &1 &2 &3 (LRECL 130 &EXIT &BEGSTACK TABS 1 10 16 31 36 41 46 69 72 80 SEPIAL ON 11 VERIFY 72
&END
EDIT 51 &3 &EXIT
This EXEC special characteristics for filetypes CHART, TABLE,
and SYSIN, and defaults an EXEC file to 130-character records. If only
one argcrment is entered, it is assumed to be the filename of a SCRIPT file. Since the editor is invoked from within the EXEC, c6ntrol returns
to EXEC after you use the FILE or QUIT subcommands during the edit You must use the &EXIT control statement so that the EXEC does
not =ontinue processing, and execute the next EDIT command in the file.
section 15. Using EXECs with CMS 303
Previous Page Next Page