RUN CONTROL PROGRAM
RUN.COM is the runtime control program with two main functions.
- The program to be run, and all CALLed programs are allocated memory and
loaded by this program.
- The runtime subroutines required by the current program are supplied by
this program.
- All .RUN compiled programs have a format which is recognised only by RUN.COM.
They must therefore be loaded into memory by this control program, which then
passes control to the loaded program.
Running a program: Invoke RUN.COM to run a program as follows:
- RUN progname [parameter]...
- Progname is the name of the .RUN compiled program file;
- Parameter is one or more optional parameters which are
required for the program which is to be run.
If RUN is invoked without a program name, the program displays the total
number of bytes in memory which are available for the program to be run,
together with any CALLed programs.
RUNTIME ERRORS
Certain conditions can arise during the running of the program which will
generate an error. These conditions cannot be detected by the compiler at
compile time.
These errors are of two types; Logic errors and File errors. In both cases,
an error comment is displayed on the screen and the program is terminated.
The format of the error comment is as follows.
COBOL12 Version 6.01 - progname Runtime Error nn - ABANDONED
Press any key ...
. nn is the two-digit error number
If the error is associated with a data file used by the program, the file path
of the file concerned is also displayed on the following line.
The logic errors are as follows.
- Insufficient memory for this program, either to load the main program or a
CALLed subprogram.
- The required program or CALLed program was not found.
- The program version (v) does not match the Run version.
This implies that the compiler and runtime programs are incompatible.
- The referenced program is not in correct format. It is either not a valid
.RUN file or the file has been corrupted.
- This error occurs when the program attempts to call more than ten
simultaneous programs.
- An attempt has been made to call the current program, or a program which
has called another program when control has not yet returned to it.
- An attempt has been made to cancel the current program, or a program which
has called another program when control has not yet returned to it.
- A subscript or index adresses a location beyond the memory limits, or a
reference modification lies outside the limits of the data item.
- There is no logical end to the last physical paragraph in the program, and
the program flow has attempted to pass beyond it.
File errors indicated by the corresponding file status code of value 20 or
greater. These are defined in the separate file description documentation.
They may be trapped and processed within the program if required, by using the
USE statement (qv).