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

Release notes - P3/COBOL Compiler - Version 17.1

General information

P3/COBOL 17.1 is supported on Java 17, designated LTS by the OpenJDK project, and on later releases. In addition to Java 17, P3/COBOL has been tested on Java 21 (a subsequent LTS release) and Java 25 (the current LTS release at the time of this writing). Testing used the latest versions from the following binary providers:

on Windows, Linux, and macOS. Other OpenJDK distributions from providers such as Oracle® and IBM® should also work with P3/COBOL 17.1, but verify behavior on one of the tested platforms above before reporting a potential problem.

Migration from 17.0.x to 17.1

Programs written for the most recent P3/COBOL 17.0 release do not require source changes to run on 17.1, with some exceptions.

RuntimeOptions

Runtime configuration options, including indexed-file volume options within file associations, are now finalized when supplied to a runtime component, except where the API exposes explicit setters. Programs or supporting Java code that modify RuntimeOptions or file-association configuration must apply all changes before passing those objects to the runtime for initialization. To vary behavior such as volume selection at runtime, define multiple file associations whose name-pattern values select the appropriate options rather than mutating options after initialization. See Selecting Volume Configuration by File Name.

RuntimeOptions runtimeOptions = (RuntimeOptions) RuntimeOptions.newRuntimeOptions("-c", "runtime.p3c");
runtimeOptions.setSuppressingTrailingSpaces(true);
 
RunUnit runUnit = RunUnit.newRunUnit(runtimeOptions);
runUnit.call("hello-universe", null, (Object) null);

Java Options

P3/COBOL 17.1 requires the Java Foreign Function and Memory API (FFM). The former sun.misc.Unsafe compatibility path, including PREFER_FOREIGN_MEMORY=false, is no longer supported. Eclipse P3/COBOL launch configurations add the required JVM options automatically by default. Java Application launch configurations can opt in to the same behavior through the P3/COBOL launch support. Applications launched outside Eclipse must supply the options required for their Java version.

Calling C/C++ from P3/COBOL

The new <native-access-enabled> runtime option directs the runtime to use restricted methods for access to native, non-Java resources when the JVM is launched with --enable-native-access=ALL-UNNAMED.

runtime.p3c
<native-access-enabled>false</native-access-enabled>

See runtime options for details.

⚠️

This option is required to be set to true, to enable P3/COBOL CALLs to native libraries!

Highlights of this Release

✨ New Features

This release adds:

  • Oracle Pro*SQL-style cursor declarations for positioned update and delete SQL statements. When a FOR UPDATE [OF] ... phrase appears in the SELECT or prepared SQL statement, the cursor is configured for updatable result sets. When it does not, but a later reference uses CURRENT OF ..., the cursor is still created as updatable.

  • Full INCITS/ISO/IEC 1989:2014 NATIONAL support, including GROUP-USAGE IS NATIONAL, NATIONAL intrinsic functions, ALPHABET clauses, and SYMBOLIC CHARACTER definitions, with expanded interaction between DISPLAY and NATIONAL data and limited LOCALE support for localized collation of both usages. See National Data in P3/COBOL and the intrinsic function summary.

  • The EXPORT statement accepts an AS TEXT phrase that suppresses generation of the XML declaration header, allowing export of plain text or other non-document XML payloads.

📘 Locale Support Disclaimer

Note on locale behavior: The COBOL 2014 and 2022 standards define a LOCALE framework for culturally aware collation, character classification, and formatting (via LC_COLLATE, LC_CTYPE, and related categories). These features are not implemented uniformly across COBOL compilers. IBM Enterprise COBOL provides limited, platform-dependent locale awareness, mainly through the operating environment (for example, CCSID and POSIX locale settings), but does not offer a standardized or portable implementation of the standard LOCALE IS ACTIVE model. P3/COBOL does not attempt to emulate that mechanism fully. Where locale-sensitive behavior is required, use USAGE NATIONAL with platform-supported locale services, or handle locale-dependent operations outside the compiler. Comparisons and string operations on UTF-8 data use strict binary collation.

🛠️ Improvements

Notable improvements include:

  • Debug hover for fully and uniquely qualified data names now shows programmatic IN/OF qualification paths.
  • IDE syntax highlighting is derived from parser token types for more accurate coloring.
  • Embedded Java in JAVA ... END-JAVA blocks is parsed as Java source by the P3/COBOL parser, improving syntax validation and error reporting; Java semantic checks run during compilation of the generated classes.
  • SELECT entries in the program outline now show the external file name and assignment target.
  • Synthetic debugger items for file names, dynamic targets, and file status now show occurrences and definitions.
  • Screen section data items now appear in the program outline.
  • JAS do statements now establish a local-variable scope consistently with for and while, correcting an omission in support for let and var declarations.
  • The default IDE dialect no longer treats COBOL 2000 DML keywords as reserved words.
  • Eclipse Java Application launch configurations can use a P3/COBOL-aware launcher that automatically adds the JVM access options required when Java code invokes P3/COBOL. P3/COBOL launch configurations provide the same option and enable it by default.
  • Remote debugging again supports an explicit request/response port pair via the debug-ports runtime option, for environments that restrict open ports.

🐛 Bugfixes

This release fixes defects including:

  • In level-78 constant expressions, the prefix NOT operator is now evaluated as a 64-bit bitwise complement, consistent with AND, OR, and EXCLUSIVE OR (via long precision), rather than as arithmetic negation. Source that relied on -x semantics for NOT should use 0 - x or otherwise adjust the expression. See Constant (Level-78) Expression Evaluation.
  • Open-ended reference modification expressions (for example [1:] and [:1]) now evaluate correctly in the Expressions view.
  • Debug hover declaration ranges now span only the declared data item, not its children.
  • Hover now displays values for synthetically defined debugger items such as file status and fn-file.
  • File status OPEN_READ_ONLY is reported when attempting to open a read-only volume.
  • Quoted string values in the Expressions view are no longer incorrectly escaped or truncated.
  • return-code values are now consistent between hover text and the Variables view. In the Variables view, return-code always refers to the currently suspended program; the Expressions view shows that same value unless the expression qualifies return-code by program name.
  • A regression in the debug Variables view after file-name refactoring has been corrected, and a null-pointer exception on hover has been eliminated.
  • Ambiguous or duplicate RECORD clauses in FILE-CONTROL entries are now diagnosed at parse time.
  • Accent-grave delimited COBOL accessors in embedded Java comments and string literals are no longer misinterpreted as Java code.
  • Handling of the NUMVAL intrinsic function has been corrected.
  • $ characters are now permitted in file paths.
  • Faulty truncation when arithmetic precision is configured above 32 digits has been corrected. This case is rare in practice and does not affect programs that use the default precision.
  • A mismatch between the PROGRAM-ID program name and the COBOL source file name (excluding the suffix) is now reported as a warning rather than an error.
  • Report names in FILE-CONTROL REPORT clauses are again correctly associated with their report files under COBOL 2000 Report Writer.
  • Decimal intrinsic functions (MAX, MIN, MIDRANGE) now handle ALL phrases with non-default DECIMAL arguments correctly.
  • Runtime volume configuration options are now enforced as immutable after initialization, correcting inconsistent indexed-file volume behavior when options were changed after being supplied to the runtime. Runtime code that modified options after initialization has also been corrected.
  • Some potential null-pointer exceptions on debugger termination have been eliminated.
  • Assignment to immutable (let) JAS local variables is now rejected at compile time.
  • Detection of malformed headers and footers in variable-length binary sequential files has been improved.
  • Read-only MV volumes are now closed without attempting to commit changes.
  • Parser errors in the IDE are now reported as warnings rather than through an Eclipse error dialog.
  • Launch configuration argument splitting now works consistently across platforms.
  • The Main-Class entry in the runtime JAR manifest has been corrected.
  • Missing CobolMath power signatures used when <integer-arithmetic-safety> is SAFE and an exponent subexpression is promoted (pow / powDecimal with long and BigInteger operands) have been added.
  • After CANCEL, working storage is reinitialized to the configured <default-byte> value before a subsequent CALL re-enters the program.
  • ACCEPT and DISPLAY statements that use the AT phrase now compile correctly when the optional WITH phrase is omitted.
  • REDEFINES of a top-level EXTERNAL data item now generates accessors against the external storage rather than program working storage.
  • DELETE FILE for a file residing in an indexed volume now removes the file reliably.
  • Writing to an indexed file that has no key specified no longer throws an array-bounds exception; the condition is handled as a file error.
  • A batch-mode failure that could report a spurious F9944 diagnostic during unified data-class generation has been corrected.

Deprecated Elements

The following elements are deprecated and may be removed in a future release.

  • The <long-arithmetic-safety> compiler option has been renamed to <integer-arithmetic-safety> to reflect the option's full range of effect. The former name remains accepted and, when present, overrides the new name. Prefer the new name in new configuration.

Further Notable Changes or Additions

  • Indexed file volumes now support read-only and retention-time configuration options. See Indexed File System.
  • When <integer-arithmetic-safety> is SAFE, narrowing conversions now perform decimalization to preserve truncated decimal values within the limits of the Java carrier type.
  • Off-heap memory access no longer offers a sun.misc.Unsafe code path. Supported approaches are the Java Foreign Function and Memory API (FFM) and, when enabled, the <native-access-enabled> runtime option described above.