GCC Newspaper
NOVEMBER 30, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
cobol

Cobol: Fix UNSTRING behavior to match ISO specification

Cobol UNSTRING processing now correctly prioritizes the first matching delimiter as per the ISO specification.

The UNSTRING operation in libgcobol has been corrected to adhere to the ISO specification’s general rules for delimiters. It now ensures that the first delimiter encountered at a given position is honored, resolving issues where subsequent delimiters at the same position might have been incorrectly prioritized. This change affects the unstring_fixed function in unstring.cc.

In Details

The unstring_fixed function in libgcobol's unstring.cc handles the parsing of delimited strings. This commit modifies its logic to align with the ISO COBOL standard's rule for UNSTRING, specifically how it resolves multiple potential delimiter matches starting at the same offset. The implementation now correctly selects the delimiter that appears earliest in the delimiter list provided to UNSTRING, ensuring deterministic behavior and compliance.

Filed Under: cobollanguage runtime