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.
<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 theSELECTor prepared SQL statement, the cursor is configured for updatable result sets. When it does not, but a later reference usesCURRENT OF ..., the cursor is still created as updatable. -
Full INCITS/ISO/IEC 1989:2014
NATIONALsupport, includingGROUP-USAGE IS NATIONAL,NATIONALintrinsic functions,ALPHABETclauses, andSYMBOLIC CHARACTERdefinitions, with expanded interaction betweenDISPLAYandNATIONALdata and limitedLOCALEsupport for localized collation of both usages. See National Data in P3/COBOL and the intrinsic function summary. -
The
EXPORTstatement accepts anAS TEXTphrase 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
LOCALEframework for culturally aware collation, character classification, and formatting (viaLC_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 standardLOCALE IS ACTIVEmodel. P3/COBOL does not attempt to emulate that mechanism fully. Where locale-sensitive behavior is required, useUSAGE NATIONALwith 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/OFqualification paths. - IDE syntax highlighting is derived from parser token types for more accurate coloring.
- Embedded Java in
JAVA ... END-JAVAblocks 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
dostatements now establish a local-variable scope consistently withforandwhile, correcting an omission in support forletandvardeclarations. - 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-portsruntime option, for environments that restrict open ports.
🐛 Bugfixes
This release fixes defects including:
- In level-78 constant expressions, the prefix
NOToperator is now evaluated as a 64-bit bitwise complement, consistent withAND,OR, andEXCLUSIVE OR(vialongprecision), rather than as arithmetic negation. Source that relied on-xsemantics forNOTshould use0 - xor 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_ONLYis reported when attempting to open a read-only volume. - Quoted string values in the Expressions view are no longer incorrectly escaped or truncated.
return-codevalues are now consistent between hover text and the Variables view. In the Variables view,return-codealways refers to the currently suspended program; the Expressions view shows that same value unless the expression qualifiesreturn-codeby 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
RECORDclauses inFILE-CONTROLentries 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
NUMVALintrinsic 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-IDprogram name and the COBOL source file name (excluding the suffix) is now reported as a warning rather than an error. - Report names in
FILE-CONTROLREPORTclauses are again correctly associated with their report files under COBOL 2000 Report Writer. - Decimal intrinsic functions (
MAX,MIN,MIDRANGE) now handleALLphrases 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-Classentry in the runtime JAR manifest has been corrected. - Missing
CobolMathpower signatures used when<integer-arithmetic-safety>isSAFEand an exponent subexpression is promoted (pow/powDecimalwithlongandBigIntegeroperands) have been added. - After
CANCEL, working storage is reinitialized to the configured<default-byte>value before a subsequentCALLre-enters the program. ACCEPTandDISPLAYstatements that use theATphrase now compile correctly when the optionalWITHphrase is omitted.REDEFINESof a top-levelEXTERNALdata item now generates accessors against the external storage rather than program working storage.DELETE FILEfor 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
F9944diagnostic 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-onlyandretention-timeconfiguration options. See Indexed File System. - When
<integer-arithmetic-safety>isSAFE, 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.Unsafecode path. Supported approaches are the Java Foreign Function and Memory API (FFM) and, when enabled, the<native-access-enabled>runtime option described above.