Repository navigation
det: DFSORT SORT step cards lowered to a COBOL SORT program, proven against GnuCOBOL (Part of #4268) - #6975
Merged
Conversation
…proven against GnuCOBOL (Part of #4268) det/dfsort.py parses SYSIN / SYMNAMES (SORT / MERGE / COPY, INCLUDE / OMIT, OPTION EQUALS; CH, BI, ZD, PD) and lowers the step to a COBOL SORT program; everything else is refused by name. The CardDemo TRANREPT, SORTTEST and COMBTRAN cards are proven byte for byte (GnuCOBOL vs the det port). Register F4 updated. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…Part of #4268) Co-Authored-By: Claude Opus 5.5 <[email protected]>
Contributor
|
No description provided. |
Contributor
|
No description provided. |
Contributor
This was referenced Oct 29, 2026
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.
Part of #4268. The first slice the brief names (the SORT / MERGE / RELEASE / RETURN parser and SORT USING / GIVING) is already on main (#4286, #4540). This PR adds the next slice: a JCL SORT (DFSORT) step, modelled and proven.
What it does
gitgalaxy/tools/cobol_to_java/det/dfsort.pyparses a SORT step's SYSIN and SYMNAMES into a model and lowers the step to a COBOL SORT program.FIELDS=(p,m,f,o)with CH, BI, ZD and PD,FORMAT=, andFIELDS=COPY.OPTION EQUALS(and the EQUALS operand), lowered to WITH DUPLICATES IN ORDER.COND: field against field or against a C'..', X'..' or decimal constant; AND / OR (& / |) with parentheses, AND binding tighter.cobolrt/Sortbehaviour is unchanged.-fsign=EBCDIC, GnuCOBOL's SORT rewrites a signed DISPLAY key's sign zone in the output records:0001comes out as000A. DFSORT and Enterprise COBOL never change record bytes.docs/language_status/register/F4.mdchanges from REFUSED to PARTIAL and cites the DFSORT Application Programming Guide (SC23-6878).Evidence
tests/cobol_mainframe/test_dfsort_4268.py, withEQUIVALENCE_E2E=1: GnuCOBOL and the det port produce byte-identical SORTOUT on six steps.Also in the file:
Class / Sibling gaps
Class: JCL utility steps run by the generated batch job and the oracle (DFSORT, IEBGENER/ICEGENER, IDCAMS, IEFBR14). Census over the burned estates' JCL: CardDemo has 6 SORT, 17 IEBGENER, 63 IDCAMS and 11 IEFBR14 steps; CBSA has ICEGENER ×8, IEBGENER ×4 and IDCAMS ×2; GenApp has IDCAMS ×10 and IEBGENER ×2; zECS has IEBGENER ×29 and IDCAMS ×3. No burned COBOL program uses the SORT or MERGE verb.
Sibling gaps:
JclSteps.utilitystill refuses every utility step in the generated job; this model is not yet wired in.Remaining slices
dfsort.pyinto the batch forge, so the generated job runs the SORT step instead of refusing it.transact.txt.Checklist
Checklist: partial [c:2148d504] -- the SORT programs are proven against the oracle in pytest; a
tests/equivalence/case that runs a SORT step is leftChecklist: partial [c:ac8b71e6] -- DFSORT subset modelled and proven; IEBGENER and IDCAMS REPRO / DEFINE are not modelled, and the forge still refuses every utility step
Checklist: partial [c:9e003ccd] -- F4 records the DFSORT subset and the oracle's key-sign rewrite; it gets updated again as IEBGENER / IDCAMS land
Gates
pr_gates --fast: 9/9 pass.pr_gates --ratchets: 9 pass.audit_check: all clear, after allowlisting the two DFSORT operand keys indead_key_audit.time_ratchet check: 0 over the limit.register.py --checkandaudit --ci: clean.pytestrun from/tmp: passes.Lessons for agents
cobc -std=ibm -fsign=EBCDIC, GnuCOBOL's SORT rewrites the sign zone of a signed DISPLAY key in the records it writes (an unsigned0001comes out as000A). Never prove record bytes through an oracle SORT keyed on a signed zoned field holding unsigned data; carry the key as a copy instead.Facts checked:
$GITGALAXY_MAINFRAME_CORPORA.-fsign=EBCDIC,-fsign=ASCIIand the default.git merge-treeagainst origin/main is clean.🤖 Generated with Claude Code