Skip to main content

Problem:

Release 4.0:

The 'CBL_ERROR_PROC' COBOL library routine installs or removes an error procedure to be invoked automatically when a runtime system error occurs.

ProgA calls the CBL_ERROR_PROC to install the entry point of ProgB as the error procedure.

ProgA and ProgB are built as separate .exe executables from the command line as follows:

cbllink -fs -s ProgA.cbl

cbllink -fs -s ProgB.cbl

Differences in behaviour between Net Express 3.0/1 and Net Express 4.0

----------------------------------------------------------------------------------------

Net Express seems to install the error procedure, while the CBL_ERROR_PROC in Net Express 4.0 returns a 0256 status-code and fails to install the error-handling procedure.

"ERROR - Unable to install RTS error trap 0256"

Resolution:

A separate EXE is a separate process and has its own Run-Time when it executes.

There is no way to install an error procedure that will exist in a separate process/separate runtime.

So the behaviour might have been different between 3.1 and 4.0 but 3.1 won't have executed the customer's error proc.

The CBL_ERROR_PROC requires a procedure pointer to the address of the error procedure. When the SET <pptr> to ENTRY ... sets up the procedure pointer value, it used to return the address of a default error routine if the entry was not found. Now it returns null. To suspect that that is where the difference lies. If 3.1 was prior to us changing the procedure-pointer behaviour then it will return a default error routine, which will then be installed as an error proc, wheres 4.0 won't install anything because it will have a null pointer.

Having ProgB as a DLL is the correct method:

cbllink -d ProgB.cbl

Regardless, the program should check that it is installing a valid error proc. To do this have

Set error-pptr to entry 'Something_Invalid'

Set pptr2 to entry 'the_real_entry'

If pptr2 not = error-pptr

    CALL 'CBL_ERROR_PROC' using ...

End-if

Old KB# 1347