Repository navigation
VSAM files -> Spring Data repositories (#3617) - #3648
Merged
Merged
Conversation
…ep in the skill Engine (galaxy_ir). vsam_stores() treats each VSAM base cluster as one store, joining: - its IDCAMS DEFINE (KEYS, RECORDSIZE, organization); - its AIXs and PATHs; - the CSD FILEs whose DSNAME is the cluster or a path; - every CICS program's EXEC CICS FILE commands (verbs, lines, INTO / FROM layouts, each RIDFLD placed in the record); - every batch program's keyed SELECT (FD layout, RECORD KEY, and the OPEN modes from the JCL lineage). _position_in places a group RIDFLD by its fields' run in the record. On CBSA, CUSTOMER-KEY lands at offset 4 for 16 bytes and ABND-VSAM-KEY at 0 for 12, matching the IDCAMS KEYS of clusters we deliberately do not join by installation-symbol name. The key is never guessed. Generator (cobol_to_java_repository_forge.py). Each store used by a converted program becomes: - an entity (entity.vsam, @entity(name = "Vsam...")): the layout of the cluster's RECORDSIZE, then the one where the most keys are fields; @id on the IDCAMS key field, a group key as an @EmbeddedId class, an ESDS / RRDS a generated Long id; - a repository (repository.vsam): JpaRepository plus STARTBR / READNEXT and READPREV as ordered range queries, and a finder per alternate index (Optional for UNIQUEKEY, else List). Each program's service gains read / write / rewrite / delete / browse methods for exactly the verbs it uses (CICS) or the OPEN modes it has (batch), each citing its lines. A differing record, an unplaced key, or a DD with no OPEN mode gets a TODO. The audit lists stores not generated and why. The estate skeleton gains vsam_stores. The modernization skill gains the consumer-audit step (#3616's lesson: list the attributes a generator consumes and check each is keyed) plus the #3617 notes. Verification: - 6 corpora x 13 configs compile via --scan. - The refraction snapshot shows 0 differ. - Full suite: 11,583 passed. - ruff, mypy and dead-key audits clean. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017ZsVaAkb86P5r5JXDC2Y9g
Contributor
…slot (#3617) CodeQL flagged the unused _n. Output is identical: all 1,504 generated Java files across 6 corpora x 3 configs are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017ZsVaAkb86P5r5JXDC2Y9g
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 #3617 (epic #3625). Builds on #3616 (#3640, merged).
What each VSAM file becomes
The unit is the data store: a base cluster, shared by CICS (through CSD FILE names) and batch (through JCL DDs). The new engine join
GalaxyIR.vsam_stores()assembles each store from:KEYS(len off),RECORDSIZE, organization, and each AIX with its PATHs;EXEC CICS FILEcommands (verbs, lines, INTO/FROM layouts), with each RIDFLD placed in the record. A group RIDFLD is placed through its fields' run.The generator (
cobol_to_java_repository_forge.py) turns each store into:@Entityinentity.vsam(@Entity(name = "Vsam…"), tablevsam_<qualifier>)@Idon itFD-TRANCAT-ACCT-ID + TYPE-CD + CD, 17 bytes)@Embeddable …Key+@EmbeddedId(plain mode: valueequals/hashCode)Longid, saying whyfindBy<Key>GreaterThanEqualOrderBy<Key>Asc(key, Pageable)/…LessThanEqual…DescfindBy<AltField>(…):Optionalfor UNIQUEKEY, elseListread…/write…/rewrite…/delete…/browse…/readAll…in that program's service, only those it uses, each citing its linesHonesty rules:
String vsamKeywith a TODO.On the corpora
@EmbeddedId@BANK_PREFIX@defines, see below)CardDemo's CARDXREF picks the CICS copybook over the batch FD: in the copybook, the AIX key at offset 25 is the field
XREF-ACCT-ID, while the FD folds it into a filler. The CICS path read becomesreadCxacaix(Long xrefAcctId)→findByXrefAcctId.No guessing on install symbols. CBSA's IDCAMS defines
@BANK_PREFIX@.CUSTOMERwhile its CSD saysCBSA.CICSBSA.CUSTOMER. They are not joined by name. The CICS store keys from the programs' RIDFLD instead:CUSTOMER-KEYat offset 4, 16 bytes. That is exactly the unjoined IDCAMSKEYS(16 4), two independent sources agreeing.Attributes consumed (consumer audit, new in the modernization skill)
VSAM definesCICS resourcesCSD resourcesfile controlinputs/outputscics_resource_data.attributesrecord_layout(computed from PIC / USAGE)record fieldskey compares names only. Spot-checked: the computed positions equal IDCAMS KEYS on 10 of CardDemo's 11 clusters (the 11th is CBEXPORT's key on a WORKING-STORAGE item, already flaggedkey_in_record=False), the 25/11 AIX, and CBSA's 4/16 and 0/12No defects found. Follow-up to key the two unverified attributes: #3649.
A near-miss worth recording: a fixture with
RECORDSIZE(38 38)past column 72 read as 3. That is correct: IDCAMS SYSIN is columns 1–72. The fixture was fixed and a note added.Verified
java_target_matrix.py --scan; CI runs it.refraction_snapshot.py checkshows 0 differ.test_vsam_repositories.py, a real scan with IDCAMS + CSD + CICS + batch + a group key): the store join, group RIDFLD placement, entities / repositories / services per verb and OPEN mode, and plain-mode key equality.🤖 Generated with Claude Code
https://claude.ai/code/session_017ZsVaAkb86P5r5JXDC2Y9g