Using Raincode COBOL with Oracle Pro*Cob


Version 4.2.490.0

1. Introduction

COBOL code containing embedded Oracle SQL statements that are running on Linux or Windows platforms can be run using Raincode products by the following process:

2. Compilation

The source code is processed with the Oracle supplied pre-processor.

The resulting COBOL code that does not contain embedded SQL can be compiled with Raincode’s COBOL compiler cobrc.exe.

At the time of execution COBOL structures will be passed to a native library. The COBOL structures must have the expected binary format.

In particular, COMP-5 integers need to be stored in a little-endian byte order. This can be done by adding the option: Comp5LittleEndian to the command line of cobrc.exe.

option: Comp5LittleEndian needs to be used with all the COBOL programs that are part of the same application.

3. Execution

The generated binary can be executed with Raincode’s runner rclrun.exe or custom runner. The necessary specific components are provided in a plugin library RainCodeLegacySqlOracle.dll.

To load the plugin, add a -Plugin=RainCodeLegacySqlOracle command-line option to rclrun.exe.

If the plugin is not in the same directory as rclrun.exe, the path must be specified with a -PluginPath=<path> command-line argument placed before the -Plugin=…​ argument.

If the starting module is not a COBOL program compiled with the :Comp5LittleEndian option (e.g. a C# module), then add a -Comp5LittleEndian option to the rclrun.exe command-line to force the binary format of COMP-5 integers.

Calls in COBOL programs that cannot be resolved to compiled COBOL programs (or C# modules) in the usual way will be handled by the plugin, which will call the corresponding entry point in the Oracle runtime library.

Unless specified with an -OracleLibrary=<path to library> option, the plugin will assume it is ORASQL8.dll and can be found by the default native library loader.

If it is a custom runner, avoid the plugin’s extra command-line options by referencing the plugin library directly and calling RainCodeLegacySqlOracle.PluginRegistration.Register with either no argument or the Oracle library path as a single argument before executing the starting module.