Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

Mapping COBOL data types to Java classes

Cobol2Java permits the object-oriented mapping of COBOL data structures to Java classes.

Cobol2Java consists of the following parts:

  • Cobol2XML, a BS2000 tool for generation of an XML description of a BS2000 COBOL structure

  • a framework with Cobol2Java conversion classes

  • a program generator for the generation of application-specific classes on the basis of this framework

The program generator makes use of an XSLT stylesheet to generate application-specific Java classes. This is performed on the basis of an XML description of the COBOL service that you can generate using the Cobol2XML tool in BS2000 systems.

The Cobol2Java classes are able to process the byte arrays of a COBOL program or generate a byte array that can be interpreted by the COBOL service. To access the individual data fields within the byte array, Cobol2Java provides data access methods appropriate for the data type as it is defined in the COBOL structure.

The figure below illustrates the generation operation.

Figure 69: Cobol2Java generation procedure

The Cobol2XML tool in a BS2000 system can be used to generate an XML file from the BS2000-COBOL source. Cobol2Java then uses this file as the basis for creation of the Java classes.

It is also possible to use Cobol2Java with COBOL programs developed for other platforms, such as Unix or Linux systems. For this to be possible, the XML description must be generated on a BS2000 system. It is not, however, possible to guarantee full functionality since the memory allocation is dependent on the COBOL compiler.