OFCOBOL Runtime Errors

This chapter describes types of runtime errors that can occur in OFCOBOL.

1. Overview

Files compiled with the OFCOBOL compiler are used as an executables or shared library files.

When executed through the OFCOBOL runtime library, COBOL files output error messages for exceptions that occur during runtime.

2. Runtime Errors

The following describes each runtime error that can occur in OFCOBOL.

Error Message Description

TEXTCON is not linked

Occurs when the program is executed without linking TXTCON.

openframe_date invalid

Occurs when the date format received from OpenFrame is invalid.

clock_gettime() failed

Occurs when OPENFRAME_TIME cannot be retrieved from OpenFrame using clock_gettime().

Packed decimal data’s hexa value is [HEXA]

Occurs when a non-packed-decimal value is received from a Usage COMP-3 (Packed Decimal).

If a value that is not in Packed Decimal format is moved into a COMP-3 field as shown in the following, an assertion occurs when the value is accessed.

01 VAR.

05 VAR-2 PIC 9999 COMP-3.

01 VAR-3 PIC 9999 COMP.

MOVE X'AAAAAA' TO VAR.

VE VAR-2 TO VAR-3.

When the --enable-hexa-packed and --expanded options are used, an assertion does not occur because the Packed Decimal table differs.

" [NAME]'s index is over than max min range (index : [NUM] )

Occurs when an index value is outside the maximum or minimum range for an OCCURS DEPENDING ON clause.

For index checking, an assertion occurs only when compiling OFCOBOL with the --check-index option. When this option is not used, only a warning message is displayed.

The following code triggers an assertion when using the --check-index option during compilation.

01 VA PIC 9(4) OCCURS 2 TIMES.

MOVE 123 TO VA(3).

Reference-modifier’s count is bigger than target size

Occurs when the value specified by the reference modifier exceeds the target size, indicating that an overflow may occur.

An assertion occurs only when the --check-index option is used.

01 VAR PIC XXXX.

MOVE "TEST" TO VAR(1:7).

Can’t find $OPENFRAME_HOME

Occurs when the OPENFRAME_HOME environment variable is not set.

Can’t find libofdebug.so

Occurs when the ofdebug library cannot be found.

Divisor is zero

Occurs when the divisor is zero.

When the --expanded option is used division by zero is handled normally, and the result is assigned 0.

01  A PIC 9999 VALUE 0.

01  B PIC 9999 VALUE 10.

01  C PIC 9999 VALUE 0.

COMPUTE A = B / C.

OFCOBOL PERFORM OVERFLOW ERROR

Occurs when PERFORM statements are repeatedly nested without exiting (default maximum stack: 32).

EntryPoint [NAME] is not Found

Occurs when the target program specified in a CALL statement cannot be found.

Can’t find PROSORT_HOME

Occurs when the PROSORT_HOME environment variable is not set.