Considerations When Moving to JVM COBOL

There are a number of things you need to consider before you start using JVM COBOL in your existing applications. You need to analyze your current application - its structure and build method - and take decisions about how these should change.

Micro Focus Professional Services is here to assist you with the transition of your application to JVM COBOL.

See below some of the areas that you need to consider.

Complexity of the original application

The complexity of your application (such as number of programs and interconnection between the programs) and the method used to compile natively play a significant role in how easily you can move to JVM COBOL. The factors include:

  • Number of programs in your application. Your application might include a very large number (e.g in the tens of thousands) of COBOL programs, and they might all compile as .int/.gnt code. When you move to JVM COBOL, you need to compile the programs as Java .class files, .exe or .dll and then need to decide how to best package the application for JVM COBOL code.
  • Large intertwined programs might have compiled successfully on the mainframe and in native COBOL. These might need to be rewritten to compile and run successfully as JVM COBOL. This is because the underlying model of the generated JVM COBOL code is object-oriented so classes and methods are being generated. In JVM, these methods have a size restriction that might be reached.

Build method of the original native application

Your original native COBOL application might be using batch scripts executed at the command line to compile. The way you compile the application is likely to change meaning you might need to adopt new and improved procedures for compiling your code.

If the batch scripts place any executable files in a certain directory structure, then this might have to change as well especially when working with Eclipse.

Programming knowledge and skills for the new technologies

When updating to JVM COBOL, you might need to invest in skills that will help you be successful in maintaining your applications. For example:

  • Compiling and running a native COBOL application compiled as JVM COBOL requires knowledge of Eclipse and Java deployment methods.
  • Compiling and running a native COBOL application compiled as JVM COBOL in an application server requires knowledge of Eclipse, Java, and the application server. You also need to understand threading and how to use Run Units.
  • Containers and Docker - requires you to learn about containerization and about developing, deploying and running applications in Docker. See Modern Development Practices.
  • Continuous Integration includes a set of software development practices for teams working on the same application base that includes testing an automation. See Modern Development Practices.

Deployment and licensing

These are handled differently in JVM COBOL code. You need to understand how to package the application and deploy it under JVM.

Database Support

You can use OpenESQL with the SQL(DBMAN=JDBC) directive to compile your JVM COBOL applications. Micro Focus tries to maintain as much source code compatibility as possible between the OpenESQL native and managed code run-time systems. Although each run-time system has extensions, limitations, and differences that are imposed by the underlying database APIs and execution environments, the majority of embedded SQL statements such as DECLARE CURSOR, OPEN, FETCH, CLOSE, SELECT, INSERT, UPDATE, DELETE, CONNECT, DISCONNECT, COMMIT and ROLLBACK, are completely compatible and require no change.

The JDBC run-time system supports object host variables as well as traditional COBOL host variables.

The following restrictions apply to database support in JVM COBOL code:

  • Oracle does not support JVM COBOL code using Pro*COBOL.

    The workaround is to move your code to OpenESQL with ODBC first and then move it to JVM COBOL code with ADO.NET.

  • Before moving to OpenESQL, you need to compile with the Pro*COBOL directives MODE=ANSI and FIPS to determine if your code includes non-standard ANSI syntax which is not supported in JVM COBOL code. Also, although some Oracle extensions might be supported by OpenESQL, others might need to be reworked.
  • Applications that use output parameters from stored procedure calls must use the COBOL directive NOILNATIVE, and object host variables cannot be used for output parameters on stored procedure calls.

Library Routines

Certain library routines are only supported in native code. See the Library Routines section of this documentation for details on the routines you can use in JVM COBOL code.

Native and JVM COBOL Code

You can call native code from JVM COBOL code although there are some environments such as J2EE application servers or web servers that could prohibit this. .

Combining native and JVM COBOL code within the same application could be restricted in some aspects especially when trying to debug the code and deploy it under JVM.

Modernization of the User Interface

Visual COBOL offers great options for modernizing your application's user interface. You can use Java Swing in the JVM. Be aware that there might be potential issues depending on the application architecture and how tightly the original user interface is tied to the back-end module.

Object-Oriented Programming

You can still write and use procedural COBOL that compiles and runs in managed environments such as the JVM. However, to take full advantage of all features available in a managed environment, and to be able to expose your code to other managed languages, you might need to start using JVM COBOL syntax. For information about writing JVM COBOL code, explore the following resources:

  • An Introduction to Object-Oriented Programming for COBOL Developers, available on the Micro Focus Customer Support Documentation Web site.
  • Study the samples contained in the Moving to JVM section of the Visual COBOL Samples samples browser installed with Visual COBOL.

Third-party Software

Examine your existing procedural COBOL code for any third-party APIs that make calls to the operating system. Technology provided by other software vendors might need to be rewritten for use with JVM COBOL code.