Repository navigation
det: PROGRAM COLLATING SEQUENCE in alphanumeric relation conditions (#4539) - #4556
Merged
Merged
Conversation
…4539) The det translator compared alphanumeric operands in byte order whatever the program's PROGRAM COLLATING SEQUENCE, silently. Now, under an EBCDIC or a literal alphabet (#4540's Sort.Collating): - The nonnumeric comparisons of IF, EVALUATE (conditions and THRU ranges), PERFORM UNTIL and condition-names (88 THRU ranges) go through Sort.Collating.relation: the shorter operand padded with spaces, IBM's order taken, operands IBM and GnuCOBOL order differently stopped by name (register D1). Items, literals, figurative constants, typed (lifted) items and function results alike. - Numeric comparisons stay by value; national data is refused by the translator already. NATIVE / STANDARD-1 / STANDARD-2 stay byte order. - An equality consults the alphabet only when it has ALSO (otherwise each character has its own position). - Refused by name: HIGH-VALUE / LOW-VALUE under a literal alphabet (MOVE, VALUE -- the program --, comparisons, DISPLAY, STRING, INSPECT), an ordering of an item holding packed / binary / signed items, a comparison with an ALL literal, an ordinal alphabet. Proof: PCSEB (EBCDIC), PCSLT (a literal alphabet with ALSO and descending THRU), PCSS2 (STANDARD-2) and PCSRV (the issue's repro) equal GnuCOBOL's output in bytes, typed and groups modes; on origin/main PCSEB, PCSLT and PCSRV differ. Refusal tests at translation and run time. Closes #4539 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01W3KVtYHQp8KsfKcHsdiPbR
2 tasks
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The det translator compared alphanumeric operands in byte order whatever the program's
PROGRAM COLLATING SEQUENCE, with no warning. Under an EBCDIC or a literal alphabet, nonnumeric relation conditions now go through #4540'sSort.Collating. This covers IF, EVALUATE (conditions and THRU ranges), PERFORM UNTIL and 88 THRU ranges, over items, literals, figurative constants, typed (lifted) items and function results:Sort.Collating.relation: pads the shorter operand with spaces and takes IBM's order. If IBM and GnuCOBOL order a pair differently, the run stops by name (register D1).Cobol.compare*/compareTexttake the collating; the service gets aCOLLATINGconstant.Proof
PCSEB(EBCDIC),PCSLT(a literal alphabet with ALSO, SPACE, a multi-character literal and descending THRU),PCSS2(STANDARD-2) andPCSRV(the issue's repro). Each one's output equals GnuCOBOL's in bytes, typed and groups modes.pr_gates: lint, audits (mypy 2.4.0), secrets, xray, gauntlet and golden pass. In the suite, onlytest_the_loops_committed_ports_are_provenfails (16 cases), and it fails the same way on a clean origin/main (fac38f6): the provenance text from the 'resurfaced' event.--ratchets: 6/6 pass after merging main (cics-crucible v0.3.0).Notes
core/special_names.pyleaves them out of scope), and the fact cross-check reads no relation semantics.Cobol.compareAllis emitted by gen.py (IF X = ALL 'ab') but does not exist in cobolrt, so that comparison would not compile. This is a separate bug; it is not fixed here.oracle_assumptions.md, D1 section.Closes #4539
🤖 Generated with Claude Code
https://claude.ai/code/session_01W3KVtYHQp8KsfKcHsdiPbR