Skip to main content

This article discusses when a run-time error occurs, the need to restart an execution at the point of the main program.

Problem:

When a run-time error occurs, it is necessary to restart an execution at the point of the main program. For example, if the COBOL applicaton is integrated with TUXEDO, or if the application COBOL is in a Web Service or in an EJB. How is this done?

Resolution:

The sample attached to this article includes the following files:

SERV21.cbl: the main program of the server. It calls SERV31.cbl. It is called with three parameters:
             INPUT field 9(4)
             OUTPUT field 9 ( 4 ) = INPUT field 23 ( if error ) = 0
             OUTPUT field X(30) = OK or Error
SERV31.cbl: called program by SERV21.cbl.
SERV41.cbl: called program by SERV31.cbl.
             If the first parameter is zero, the error 163 is caused
             If the first parameter is 9999, the error 173 is caused

ERRMAIN.cbl, ERRPROC.cbl, jmpcprog.c: modules to manage errors

testserv.cbl: the test module for the demonstration

makefile: makefile file to compile and run the application

Syntax:

make ESSAI

The example is resumed.zip

6874.resumed.zip

Old KB# 14901