Repository navigation
det: refuse a RECORD KEY outside the file's record (Fixes #4804) - #4984
Merged
Merged
Conversation
…cord (Part of #4804) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Owner
Author
|
No description provided. |
squid-protocol
marked this pull request as ready for review
October 12, 2026 12:56
squid-protocol
enabled auto-merge (squash)
October 12, 2026 12:56
Owner
Author
|
No description provided. |
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.
Closes #4804
The det translator now refuses a RECORD KEY / ALTERNATE RECORD KEY whose item is not in a record of the file's own FD, by name. IBM Enterprise COBOL Language Reference (RECORD KEY clause) requires the key in a record description entry of that file; GnuCOBOL (the instrument) refuses it too. No translation is invented.
What changed
det/program.py:file_controlalso reads everyALTERNATE RECORD KEY;_keys_outside_recordresolves each key and checks its 01 root is one of the FD's records. If not, the file'swhyis<key> is not defined in a record of file <SELECT> ..., so every statement on the file is a named hole.docs/language_status/register/F5.md, page re-rendered).tests/cobol_mainframe/test_det_record_key_4804.py: key-in-FD (whole), key-in-WS (refused), ALTERNATE KEY outside (refused), ALTERNATE KEY in FD (whole), qualified WS key (refused), key in a second 01 of one FD (whole), key in another file's record (refused). A key via COPY inside the FD is the same item layout as the in-FD case (COPY is expanded before layout). No counts asserted.Evidence (real CardDemo sources, translated with the batch package present): CBIMPORT and CBEXPORT each now carry
EXPORT-SEQUENCE-NUM is not defined in a record of file EXPORT-INPUT / EXPORT-OUTPUTholes on OPEN / READ / WRITE / CLOSE, so neither counts whole.Class: key item placement for indexed files. Siblings: RELATIVE KEY (IBM: not in the file's own record) is already refused as
ORGANIZATION RELATIVE.Gates:
pr_gates --fast5/5 pass;--ratchets7/7 pass (nothing moved: CBEXPORT/CBIMPORT are in no gated set);det_port.py check: 104/104 ports unchanged.Cross-repo: none.
🤖 Generated with Claude Code