Use IBM Enterprise COBOL for z/OS or later compiler if the external routine is to be run on multiple threads of a multi-threaded application, such as a Native Execution Environment. Older programs written in OS/VS Cobol or COBOL II should be recompiled with this new compiler.
A COBOL run-unit is created when you invoke a COBOL external routine and terminated when the COBOL program issues a GOBACK to return control to TIBCO Object Service Broker. A subsequent call to the routine within the same transaction causes the routine to be executed as though it were being called for the first time. If the routine opens files or sets flags, expecting to use this environment on subsequent calls, processing errors occur, with possible abends or incorrect logic paths.
To ensure that a COBOL run-unit is not terminated prematurely and is active for the life of the current rule stream/transaction level, you can take the following steps. Additional information can be found in the IBM “Enterprise COBOL for z/OS Programming Guide”.
Your COBOL external routine can override TIBCO Object Service Broker error-handling with a runtime option. If the program has its own error handling, it must restore TIBCO Object Service Broker error-handling, including the program mask, before returning. Failure to do so produces unpredictable results.
The following routine shows how to define the arguments in COBOL. The sample external routine requires five arguments. The routine and its arguments must be identified to TIBCO Object Service Broker as described in
Identifying Your External Routine to TIBCO Object Service Broker.