Skip to content

feat(cobol-to-java): JCL job flow -> Spring Batch jobs (#3622) - #3711

Merged
squid-protocol merged 1 commit into
mainfrom
feat/batch-jobs-3622
Sep 26, 2026
Merged

squid-protocol merged 1 commit into
mainfrom
feat/batch-jobs-3622

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Closes #3622. Part of #3625.

The key finding: most JCL isn't application work

Across the reference estates, most jobs compile (IGYCRCTL), link (HEWL/IEWL), assemble, translate, update the CSD or drive a workload simulator. Turning those into Spring Batch jobs would be wrong, so every job is classified from its steps (PROCs expanded):

class meaning becomes
application runs a program of the estate (EXEC PGM= or through a PROC) a Spring Batch Job
runner runs IKJEFT01 / DFSRRC00, whose program is in SYSTSIN / PARM (not resolved yet: #3710) listed, with the reason
utility data utilities only (VSAM defines, loads, copies) listed
build compilers, linkers, CSD updates, tooling listed

The listing ships as resources/batch/jcl-jobs.json.

estate JCL jobs application (steps) runner utility build
CardDemo 55 11 (19 steps, 6 utility steps to port) 11 23 10
zopeneditor 8 1 (6 steps) 0 4 3
CBSA 46 0 36 (IKJEFT01: #3710) 1 9
GENAPP 29 0 3 5 21
zECS 10 0 3 0 7

What an application job becomes

Each becomes <Job>JobConfig: one @Bean Job with its steps in JCL order and a PROC's steps as STEP.PROCSTEP. Repeated step names get #ordinal. Each step's DDs are constants from the verified facts. The job runs on a small runtime in the batch package:

  • Dd / DatasetResolver: datasets as files under gitgalaxy.datasets.directory. A GDG is a directory of generations (G0001V00…): (+1) is the next, (0) the current.
  • JclConditions:
    • COND= at step and job level bypasses the step exactly as JCL does. The step is skipped when any test code op RC holds, e.g. (0,NE) or ((4,LT),(8,GT,STEP1)).
    • IF (…) THEN evaluates RC, STEP.RC, AND / OR / NOT and the relational operators.
  • JclSteps:
    • a program step calls its service's runBatch(dds) and records the RETURN-CODE (exit status RC=n or BYPASSED);
    • IEFBR14 creates or deletes datasets per their DISP;
    • IEBGENER copies SYSUT1 → SYSUT2;
    • any other utility (SORT, IDCAMS, …) fails the job with its TODO, unless gitgalaxy.batch.skip-unimplemented is set. It is never a silent success.
  • JclJobLauncher + BatchJobController: GET /api/v1/batch/jobs lists jobs and POST /api/v1/batch/jobs/{name} runs one.

Each program run by a job gets a documented runBatch(List<Dd>) entry listing each DD's mode and dataset (dataset_lineage). A program that submits a job through the internal reader gets a submit helper that launches the generated job. When the submitted JCL runs a PROC with no generated job (CardDemo CORPT00C → PROC TRANREPT), it gets a precise TODO instead.

Engine changes (both additive)

  • GalaxyIR.job_dds, a new estate join: each step's DDs. DD rows carry no step ordinal, so they're associated by step order; this matters because CardDemo's TRANREPT has two steps named STEP05R. PROC DDs are expanded and GDG generations split off.
  • job_flow records DISP's normal-end disposition (disp_normal): a presence-keyed column, healed into old tables, restored by the rehydrator, with old databases still loading.
    • Without it, IEFBR14's classic DISP=(MOD,DELETE,DELETE) ("delete if it exists") looked like "create".
    • This attribute is not yet key-verified: the JCL job flow census checks the DISP status only.

Evidence

  • Compiles: 85/85 (CardDemo, zopeneditor, CBSA, GENAPP and zECS × 17 configs).
  • Runtime. I ran throwaway tests, not committed, in the generated CardDemo app booted on H2:
    • READACCT's IEFBR14 step deletes last run's output, then CBACT01C's runBatch runs: COMPLETED, RC=0;
    • CREASTMT fails at its unported IDCAMS step and never runs STEP040;
    • POST /api/v1/batch/jobs/POSTTRAN returns COMPLETED;
    • COND / IF / GDG behaviour checks pass.
  • Engine safety: 0 of 48 IR joins move on any corpus (ir_join_diff --rescan), and the ground-truth ledger is unchanged and clean.
  • Tests: full suite 11,804 passed; preflight --java all PASS.
  • test_batch_jobs.py: a real scan covering IEFBR14 with the delete idiom, SORT with in-stream cards, a program step with COND=(4,LT) reading a GDG (+1), a cataloged PROC with IEBGENER, and build / runner / utility jobs. It also covers job_dds, the listing, the job config, runBatch, the manifest, the worklist and the audit.

Also

  • Messaging (Java conversion: TS / TD queues, containers and MQ -> messaging adapters #3620): the internal-reader route's TODO now yields to the batch forge only when the engine resolved the write to a job submission.
  • X-Ray: the PL/I compiler's name (IBM + ZPLI) is split in the forge, because the full name contains the DOS executable signature, which the inspector flags in a file's first 8 KB.
  • Worklist: a new Utility job steps to port category, and runBatch's TODO counts as business logic.

🤖 Generated with Claude Code

https://claude.ai/code/session_017ZsVaAkb86P5r5JXDC2Y9g

Most JCL is not application work. Each job is classified from its steps (PROCs expanded):
- application: runs an estate program -> a Spring Batch job;
- runner (IKJEFT01 / DFSRRC00, program in SYSTSIN / PARM, #3710), utility (IDCAMS / IEBGENER /
  SORT / IEFBR14 only) and build (compilers, linkers, CSD, tooling): listed in
  resources/batch/jcl-jobs.json with the reason, not generated.

An application job becomes <Job>JobConfig: one Job, steps in JCL order, a PROC's steps as
STEP.PROCSTEP, each step's DDs as constants. Over a runtime in the batch package:
- Dd / DatasetResolver: datasets as files, GDG generations as G####V00;
- JclConditions: COND= (step and job) bypasses as JCL does; IF (RC, step.RC, AND/OR/NOT);
- JclSteps:
  - a program step calls its service's runBatch(dds) and records RETURN-CODE;
  - IEFBR14 creates / deletes per DISP;
  - IEBGENER copies SYSUT1 -> SYSUT2;
  - other utilities fail the job unless gitgalaxy.batch.skip-unimplemented -- never a silent
    success;
- JclJobLauncher + BatchJobController run a job by JCL name.
A program that submits a JCL job through the internal reader (job_submissions) launches it.

Engine:
- GalaxyIR.job_dds: each step's DDs, by step order (DD rows carry no ordinal), PROC DDs
  expanded, GDG split; a new estate join;
- job_flow records DISP's normal-end disposition (disp_normal: presence-keyed column, healed,
  rehydrated, old DBs load): IEFBR14's DISP=(MOD,DELETE) deletes, not creates.

Compiles 85/85 (5 corpora x 17 configs). Runtime in the generated CardDemo app on H2: READACCT
deletes its old output (IEFBR14) then runs CBACT01C's entry, RC=0; CREASTMT fails at its
unported IDCAMS without running STEP040; REST runs POSTTRAN; COND / IF / GDG checks.
0/48 IR joins move; ledger clean.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017ZsVaAkb86P5r5JXDC2Y9g
@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-protocol
squid-protocol merged commit 2e8e14b into main Sep 26, 2026
36 checks passed
@squid-protocol
squid-protocol deleted the feat/batch-jobs-3622 branch September 26, 2026 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Java conversion: JCL job flow -> Spring Batch jobs

1 participant