🛠️ P3/COBOL 25.1.0-SNAPSHOT is available for preview.
Release Notes
Version 17.0

Release notes - P3/COBOL Compiler - Version 17

General information

P3/COBOL 17 is supported on Java 17 (designated LTS by the OpenJDK project) and later releases. P3/COBOL has been tested on Java 21 (the current LTS release as of writing) and version 22 (the current release as of writing) as well. Testing was performed with the latest versions of these from the following binary providers:

on Windows, Linux, and macOS platforms. Other binary providers of the OpenJDK® systems, such as Oracle® and IBM® will also work with these versions of P3/COBOL, but behavior should be verified using one of the above tested platforms before reporting a potential problem for investigation.

Migration from 8.3.x to 17.0.0

Programs written for the most recent version of P3/COBOL 8.3 do not require any changes to operate properly on version 17 except for the following considerations regarding the Java command-line launcher options used when running the programs.

Running P3/COBOL on the supported versions of Java

The following JVM option alternatives describe P3/COBOL 17.0. Starting with P3/COBOL 17.1, FFM is required and the sun.misc.Unsafe alternatives are no longer supported. See the 17.1 migration notes and the current required JVM options.

Using the P3 Utility (Preferred)

When running a P3/COBOL program from the p3 command line utility on any of the supported Java versions, the required Java options are set automatically. For example, as shown below, no additional Java (JVM) options are required for launching a COBOL program.

p3 r -i hello-world

Using the Java launcher command directly

Running a P3/COBOL program using the java launcher directly from the command line, you should specify some additional Java (JVM) options. For example running on Java 17 you might specify:

java \
-cp bin:bin-cobol:$P3_HOME/lib/p3cobol.jar \
com.turrettech.launch.P3RunLauncher \
-i hello-world

But for most programs additional options must be specified (at runtime only) in order to use all P3/COBOL features. They depend on the actual Java version used as follows:

Java 17 (LTS)
--add-opens java.base/java.lang=ALL-UNNAMED
--add-opens java.base/java.util=ALL-UNNAMED
Java 21 (LTS)
--add-opens java.base/java.lang=ALL-UNNAMED
--add-opens java.base/java.util=ALL-UNNAMED
Java 22 and above
--add-opens java.base/java.lang=ALL-UNNAMED
--add-opens java.base/java.util=ALL-UNNAMED

Note, however, that you may make use of this Java launcher feature to set the above options for all java launches.

Foreign Functions and Memory Access

This version of P3/COBOL will use the Java Foreign Functions and Memory (FFM) feature for all non-Java heap memory access by default. When running on Java 17 or 21, however, use of the sun.misc.unsafe... methods (the default in P3/COBOL version 8.x and prior versions) may be forced by setting the advanced configuration Java property PREFER_FOREIGN_MEMORY property to false. In any case if, for whatever reason, non-heap memory is required and the FFM implementation cannot be used, P3/COBOL will attempt to use sun.misc.unsafe... irrespective of the property setting.

Highlights of this Release

📝 Of Particular Note

Java 17, 21, and beyond

  • Java versions 17, 21 (including the now-standard FFM feature) are fully tested and supported by this P3/COBOL release. Subsequent Java feature releases (22 and later) are supported according to standard Java support expectations.
  • The P3-Utility command now supports Java versions 17, 21, 22 and beyond.

Eclipse 2024-03 and beyond

  • The Eclipse IDE plugin minimal base version is now 2024-03. This release and any subsequent release may be used with this P3/COBOL release.

New parser

  • This P3/COBOL release utilizes a new parser based on the modern and powerful CongoCC parser generator, which is now used for all compilations. CongoCC is the modern replacement for the original JavaCC parser generator, and it improves maintainability and provides more robust and predictable parsing behavior.

    In addition to these significant internal advantages, much more precise location of parsing errors is made possible with the use of CongoCC, and this and other capabilities brought by this change will be increasingly utilized in future P3/COBOL releases.

✨ New Features

Features added to this release include:

  • IBM-style XML PARSE and XML GENERATE support has been added to P3/COBOL. The EXPORT and IMPORT statements continue to be fully supported as well.
  • A new, lightweight, P3RunLauncher is provided to simply run a P3/COBOL program.
  • Positioned UPDATE and DELETE within result sets is now supported by Embedded SQL (ESQL).
  • Floating point items (COMP-1 and COMP-2) are now supported by ESQL.
  • An experimental capability to track dynamic usage of memory has been added. This enables the development of a wide range of powerful, domain-specific, tools to aid in the remodeling of COBOL-based applications.

🛠️ Improvements

Several notable improvements have been made to elements of P3/COBOL. Included are:

  • IDE memory usage and performance has been significantly improved when a large number of copybooks and/or large programs are used.
  • A set of pre-built p3bridge implementations is now included in the core P3/COBOL distribution.
  • The obsolete --java-arguments (-j) option and its description have been removed from the runtime configuration documentation, as the p3 utility provides a much easier way of accomplishing this.
  • The experimental JAS feature has several improvements such as the addition of distinct immutable (let) and mutable (var) local variable declarations.

🐛 Bugfixes

Among the bugs fixed in this release are:

  • Alphanumeric symbolic constants (i.e., 78 variables) are now correctly evaluated when used alone in a VALUE clause.
  • End-of-line comments (*>) are now universally allowed within COBOL statements.
  • Several NullPointerExceptions (NPE) when undefined identifiers are used in some contexts, such as the TALLYING phrase, have been eliminated.
  • All error codes have been made unique, correcting a deficiency in prior releases.
  • USAGE POINTER items are no longer (incorrectly) initialized to NULL when they are in REDEFINES groups.
  • OPENing an OPTIONAL relative organization file that does not exist will now reliably work in a Windows environment.
  • Eclipse "Cheat sheets" are now consistent with current product version behavior/features.
  • Debugging programs with _ (underscore) in the program name now works correctly.
  • Some situations of file initialization's leaving indexed file-level locks in place have been corrected.
  • Some issues with C$SYSTEM usage on Windows have been corrected.
  • Non-ISO_8859 Unicode characters no longer result in obscure compiler errors when used in source.
  • Issues with the file SELECT declaration when using Visual COBOL extensions have been corrected.
  • Missing methods in the ByteStore library class have been added, no longer resulting in occasional, but rare, Java syntax errors in the generated code.