PreviousCode Generation Messages File Status CodesNext"

Chapter 4: Run-time System Messages

The messages described in this chapter are reported by the run-time system (RTS) and can occur as follows:

Some of these messages are environment dependent, and so your particular environment might not support them all.

An RTS error is returned on a program that is syntactically correct and occurs when problems are encountered during the actual running of the code. You could receive such an error if you try to access a file in the wrong mode or if you use a corrupt file. RTS errors are thus environment dependent and their handling depends very much upon the situation in which they occur.

4.1 Format of Messages

The 16-bit COBOL system displays run-time system messages in one of the following two formats:

Run time error number: nnn


[Error accessing file: file-name program-name segment: ss error nnn at COBOL PC xxxxH       [Description: message-text]


nnn is the error number
file-name is the name of any failing data file. Shown as "?" if the filename is not known
program-name is the name of the program being executed
ss is the number of the segment being executed (RT for ROOT)
xxxx is the position of the program counter, in hexadecimal, and can be related back to the source program using the REF Compiler directive.
message-text is the error message

In the second format, the first optional line is output only if the error occurred during COBOL I/O. The second optional line is output only if the file rts.err is available in an open library.

The 32-bit COBOL sytems display run-time system messages in one of the following two formats:

action error: file 'file-name'
error-code:yyy, pc=xxxxxxxx, call=m, seg=ss 
nnn message-text


rts32: message


action is what the run-time system was actioning at the time of the error. For example, execution, I/O, load or write.
file-name is the name of the file on which the run-time system was operating
yyy is either the run-time system error number or, if the error is caused by an I/O operation, the file status value. If the latter, the file status mappings currently on force are also displayed.
xxxxxxxx is the position of the program counter, in hexadecimal, and can be related back to the source program using the REF Compiler directive.
m is a number used internally to identify the program in error. Zero indicates the main program, nonzero a subprogram.
ss is the number of the segment being executed (0 for ROOT)
nnn is the error number
message-text is the error message
message is one of:
  • Not enough room for message
  • Fatal error while attempting to process error yyy

4.2 Types of Error

There are two types of run-time error; exceptions and I/O errors. I/O errors are either fatal or recoverable; the latter being reported by the operating system so that you can trap them and take steps to recover from them if at all possible. Exceptions are fatal errors which are not reported and so cannot be trapped.

4.2.1 Exceptions

These are fatal errors covering conditions such as arithmetic overflow, too many levels of PERFORM nesting, and subscript out of range.

4.2.2 I/O Errors

These are either fatal or recoverable errors, which cause one of the following to take place:

You must examine status key 1 after each file operation to ensure that the operation has been carried out successfully. 0 in status key 1 indicates the successful completion of a file operation; any other value indicates an error condition of some type.

If an error condition is reported, the action which your program then takes is entirely your responsibility. If your program does not terminate when an error is reported, its subsequent behavior might not be as you would expect. Fatal Errors

Fatal errors cause a message to be output to the console, and once this error message has been displayed your program terminates immediately.

Although you cannot recover from such an error during the run of your program, once it has terminated you might be able to take steps to rectify the conditions which caused the error to occur. The list of run-time system error messages gives hints on how this might be achieved for individual errors. Recoverable Errors

You can trap recoverable errors in your program, but the action you take when one of these errors is received is your responsibility.

4.2.3 Error Handling

Having received a file error you can deal with it in one of many ways. You might want your program to display its own general error message, close any open files (if this is possible) and terminate. This should enable you to save any data which you have already written to the files. This data could be lost if you do not trap the error.

Should you want to recover from an error and to continue to run your program, code your program in such a way as to take action should a particular error be reported. For example, if you receive a "file not found" error then your program could prompt you to insert a disk containing the required file into a specified drive, if your operating system supports this.

Hints on how to recover from specific errors are given later in this chapter but you will be able to follow these hints only if you have coded your program in such a way as to be able to take advantage of them.

The following points suggest ways in which you might want to code your program to handle recoverable errors.

4.2.4 Return-code Values

The run-time system always returns a value to the operating system when a COBOL program terminates. If the program terminates normally, the value is taken from the program's special register RETURN-CODE If the run-time system terminates the program because an unrecoverable error has occurred or because it has received a message from the operating system to quit immediately, the value returned depends on the operating system as described below.

DOS, Windows and OS/2::
The value returned is 32 for a run-time system error and 16 for a quit interrupt when running under DOS, Windows or OS/2. A keyboard quit interrupt is generated when the user presses Ctrl + Break. Use the if command with the errorlevel parameter to test the returned value, as shown in the following batch file fragment:

run myprog  
if errorlevel 32 goto rts_error 
if errorlevel 16 goto rts_interrupt 

The run-time system returns a value of -1 for a run-time system error and -2 for an abnormal termination on receiving the UNIX quit or kill signal. Typically, many UNIX implementations translate the value of -1 to the unsigned value 255, and the value -2 to the unsigned value 254. You can configure the RTS to ignore quit or kill signals generated from the keyboard by using the run-time switch i (see your COBOL System Reference chapter Running for further details). Use the Bourne shell special parameter ? to obtain the value returned to the operating system, as shown in the following shell script fragment:

cobrun prog
if test $? -eq 255
    then echo "Abnormal termination"

See your operating system documentation for further details of how interrupts can be generated and how to handle values returned by a program.

4.3 List of Messages

001  Insufficient buffer space (Recoverable)
002  File not open when access attempted (Recoverable)
003  Serial mode error (Recoverable)
004  Illegal file name (Recoverable)
005  Illegal device specification (Recoverable)
006  Attempt to write to a file opened for INPUT (Recoverable)
007  Disk space exhausted (Fatal)
008  Attempt to input from a file opened for OUTPUT (Recoverable)
009  No room in directory (Recoverable)
010  File name not supplied (Recoverable)
011  Process limit reached (Fatal)
012  Attempt to open a file which is already open (Recoverable)
013  File not found (Recoverable)
014  Too many files open simultaneously (Recoverable)

See also: /F RTS switch
015  Too many indexed files open (Recoverable)
016  Too many device files open (Recoverable)
017  Record error: probably zero length (Recoverable)
018  Read part record error: EOF before EOR or file open in wrong mode (Recoverable)
019  Rewrite error: open mode or access mode wrong (Recoverable)
020  Device or resource busy (Recoverable)
021  File is a directory (Fatal)
022  Illegal or impossible access mode for OPEN (Recoverable)
023  Illegal or impossible access mode for CLOSE (Recoverable)
024  Disk input-output error (Recoverable)
025  Operating system data error (Fatal)
026  Block I-O error (Fatal)
027  Device not available (Recoverable)
028  No space on device (Fatal)
029  Attempt to delete open file (Recoverable)
030  File system is read-only (Recoverable)
031  Not owner of file (Recoverable)
032  Too many indexed files, or no such process (Recoverable)
033  Physical I-O error (Fatal)
034  Incorrect mode or file descriptor (Recoverable)
035  Attempt to access a file with incorrect permission (Recoverable)
036  File already exists (Recoverable)
037  File access denied (Fatal)
038  Disk not compatible (Fatal)
039  File not compatible (Fatal)
040  National Language initialization not set up correctly (Fatal)
041  Corrupt index file (Recoverable)
042  Attempt to write on broken pipe (Recoverable)
043  File information missing for indexed file (Fatal)
044  Attempt to OPEN an NLS file in a non-NLS program (Fatal)
045  Attempt to OPEN an NLS file using incompatible language definition (Fatal)
046  NLS support module not found (Fatal)
047  Indexed structure overflow (Fatal)
048  Attempt to divide by zero (Fatal)
048-057  Host file status, not an RTS message
055  Routine table overflow (Fatal)
065  File locked (Recoverable)
066  Attempt to add duplicate record key to indexed file (Fatal)
067  Indexed file not open (Recoverable)
068  Record locked (Recoverable)
069  Illegal argument to isam module (Fatal)
070  Too many indexed files open (Recoverable)
071  Bad indexed file format (Fatal)
072  End of indexed file (Fatal)
073  No record found in indexed file (Fatal)
074  No current record in indexed file (Fatal)
075  Indexed data file name too long (Fatal)
076  Can't create lock file in /isam directory (Fatal)
077  Internal ISAM module error (Fatal)
078  Illegal key description in indexed file (Fatal)
079  COBCONFIG syntax error (Fatal)
081  Key already exists in indexed file (Fatal)
082  CALL convention not supported (Fatal)
086  Remote file system failure (Fatal)
099  Illegal operation in SORT/MERGE module (Fatal)
100  Invalid file operation (Fatal)
101  Illegal operation on an indexed file (Fatal)
102  Sequential file with non-integral number of records (Fatal)
103  Parameter cannot be passed BY VALUE (Fatal)
104  Null file name used in a file operation (Fatal)
105  Memory allocation error (Fatal)
106  Dictionary error (Fatal)
107  Operation not implemented in this run-time system (Fatal)
108  Failure to initialize data division (Fatal)
109  Invalid checksum in run-time system (Recoverable)
110  Generated code not supported by this RTS (Fatal)
111  Incompatible Class Library and Run-time Environment versions (Fatal)
112  Unable to locate/access the required security key (Recoverable)
114  Attempt to access item beyond bounds of memory (Fatal)
115  Unexpected signal (Fatal)
116  Cannot allocate memory (Fatal)
117  Bad collating sequence (Fatal)
118  Symbol not found (Fatal)
119  Symbol redefined (Fatal)
120  Symbol string table of zero size (Fatal)
121  Symbol is not in TEXT section (Fatal)
122  Coblongjmp() called below level of cobsavenv() (Fatal)
123  Unknown relocation type (Fatal)
124  Communication failure during I/O request to the central file handler
125  All locks/ current transactions canceled due to exceeding time limit
126  Record size exceeds system limit (Fatal)
129  Attempt to access record zero of relative file (Recoverable)
135  File not found (Recoverable)
137  Illegal device specification - not mass storage
138  File closed with lock - cannot be opened (Recoverable)
139  Record length or key data inconsistency (Recoverable)
141  File already open - cannot be opened (Recoverable)
142  File not open - cannot be closed (Recoverable)
143  Rewrite/delete in sequential mode not preceded by successful read (Recoverable)
144  Boundary violation (Recoverable)
146  No current record defined for sequential read (Recoverable)
147  Wrong open mode or access mode for read/start (Recoverable)
148  Wrong open mode or access mode for write (Recoverable)
149  Wrong open mode or access mode for rewrite/delete (Recoverable)
151  Random read on sequential file (Recoverable)
152  REWRITE on file not opened I-O (Recoverable)
153  Subscript out of range (Fatal)
154  PERFORM nested too deeply (Fatal)
155  Illegal command line (Fatal)
156  Too many parentheses in compute statement (Fatal)
157  Not enough program memory: object file too large to load (Recoverable)
158  Attempt to REWRITE to a line-sequential file (Recoverable)
159  Malformed line-sequential file (Recoverable)
160  Overlay loading error (Recoverable)
161  Illegal intermediate code (Fatal)
162  Arithmetic overflow or underflow (Fatal)
163  Illegal character in numeric field (Fatal)
164  Run-Time subprogram not found (Fatal)
165  Version number incompatibility (Fatal)
166  Recursive COBOL CALL is illegal (Fatal)
167  Too many USING items (Fatal)
168  Stack overflow (Fatal)
169  Illegal configuration information (Fatal)
170  System program not found (Fatal)
171  Japanese operations illegal with this RTS (Fatal)
172  Recursive non-MF PERFORM is illegal (Fatal)
173  Called program file not found in drive/directory (Fatal)
174  Imported file not found (Fatal)
175  Attempt to run intermediate code program which had severe errors in  it (Fatal)

See also: E RTS switch
176  Illegal intersegment reference (Fatal)
177  Attempt to cancel program failed (Fatal)

See also: D2 RTS switch O RTS switch
178  Error during save (Fatal)
179  Error during chain (program not found) (Fatal)
180  End-of-file marker error (Fatal)
181  Invalid parameter error (Fatal)
182  Console input or console output open in wrong direction (Fatal)
183  Attempt to open line sequential file for I-O (Fatal)
184  ACCEPT/DISPLAY I-O error (Fatal)
185  File malformed (Recoverable)
186  Attempt to open stdin, stdout or stderr with incorrect mode (Recoverable)
187  Run-time system not found on $COBDIR path (Fatal)
188  Filename too large (Fatal)
189  Intermediate code load error (Fatal)
190  Too many arguments to CALL (Fatal)
191  Terminal type not defined (Fatal)
192  Required terminal capability description missing (Fatal)
193  Error in variable length count (Fatal)
194  File size too large (Fatal)
195  DELETE/REWRITE not preceded by a read (Fatal)
196  Record number too large in relative or indexed file (Fatal)
197  Screen handling system initialization error (Fatal)
198  Load failure (Fatal)
199  Operating System error code lies outside expected range (Fatal)
200  Run-time system internal logic error (Fatal)
201  I-O error in paging system (Fatal)
202  Exported functionality error (Fatal)
203  CALL parameter not supplied (Fatal)
204  Mainframe Pointer Manager (MFPM) module is required but not loaded (Recoverable)
205  Invalid mainframe pointer value (Fatal)
206  Reading unwritten data from memory (Fatal)
207  Machine does not exist (Recoverable)
208  Error in multi-user system (Fatal)
209  Network communication error (Recoverable)
210  File is closed with lock (Fatal)
211  Program not executable by run-time system (Fatal)
213  Too many locks (Recoverable)
214  GO TO has not been ALTERed (Fatal)
215  Cannot ANIMATE a program running COMMUNICATIONS (Fatal)
216  Cannot initialize the named communications device (Fatal)
217  Incompatible host for native code file (Fatal)
218  Malformed MULTIPLE REEL/UNIT file (Fatal)
219  Operating system shared file limit exceeded (Recoverable)
220  Attempt to execute more than one SORT or MERGE simultaneously (Fatal)
221  SORT/MERGE error: see status keys (Fatal)
222  SORT/MERGE error: see status keys (Fatal)
223  SORT/MERGE error: see status keys (Fatal)
224  External Language Initialization failure
225  Dynamic load error - program component missing (Fatal)
226  EXTERNAL file definition inconsistent
227  EXTERNAL data definition inconsistent (Fatal)
228  Could not allocate memory for EXTERNAL item (Fatal)
229  SORT/MERGE module does not support EXTERNAL using/giving  files (Recoverable)
230  Floating Point Support Module not found (Fatal)
235  Error in animator communications channel (Fatal)
236  Animated program has terminated unexpectedly (Fatal)
237  Unable to initialize animated process (Fatal)
238  STOP RUN encountered during GNT animation (Informational)
239  Shared run-time system initialization failure (Informational)
240  Object reference not valid (Fatal)
241  Cannot instantiate an abstract class (Fatal)
242  Could not resolve DoesNotUnderstand message (Fatal)
243  Class could not be loaded (Fatal)
254  Keyboard interrupt to ANIMATOR during ACCEPT (Fatal)

Copyright © 1999 MERANT International Limited. All rights reserved.
This document and the proprietary marks and names used herein are protected by international law.

PreviousCode Generation Messages File Status CodesNext"