Skip to content

Mainframe fact channel: JCL job flow -- steps, conditions, dataset flow (#3451) - #3471

Merged
squid-protocol merged 2 commits into
mainfrom
feat/jcl-job-flow-3451
Sep 24, 2026
Merged

squid-protocol merged 2 commits into
mainfrom
feat/jcl-job-flow-3451

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Closes #3451. Part of #3445. Stacked on #3470; GitHub retargets it to main when #3470 merges.

What

New channel job_flow_data (core/job_flow.py), with one row per JOB, EXEC step, and DD that names a DSN:

  • JOB: its COND=.
  • STEP: its ordinal within its job or PROC, PGM= or PROC= (or positional), COND= as written, and the enclosing IF conditions. ELSE is recorded as NOT (...) and nested conditions are joined with AND. The row also names the PROC the step belongs to.
  • DD: DSN (generation stripped), DISP (NEW / OLD / SHR / MOD; NEW when a DSN has no DISP), and GDG generation.

The shared statement parser drops two things this channel needs, so the channel has its own statement reader:

  • proc-step override DDs (//PRC001.FILEIN DD);
  • IF / ELSE / ENDIF.

Unnamed concatenation DDs take the name of the DD above them.

New joins in galaxy_ir:

  • job_steps(): each job's steps in order, with PROC calls expanded into the procedure's steps. A PROC resolves in-stream, or to the cataloged member (.prc preferred).
  • job_dataset_flow(): DDs that create a dataset (DISP NEW / MOD) joined to DDs that read the same dataset (SHR / OLD), matched on the resolved DSN. Within one job, the reading step must come later.
    • DISP decides, not the generation. A later step's X(+1),DISP=SHR reads what the job created; a test caught my first version getting this wrong.
    • Scheduler order isn't in the repository, so cross-job edges are candidates, not a schedule.

Corpora

  • CardDemo:
    • 56 jobs, 137 steps; all 9 PROC calls expanded; 22 conditional steps.
    • 44 dataset producer→consumer edges, 31 of them cross-job (e.g. UNLDPADB → LOADPADB).
  • CBSA: 46 jobs, and all 90 PROC calls expanded. Its DSNs stay symbolic, so there are no edges.

Ground truth

  • Independent reader: add-job-flow.
  • New scored field: JCL job flow, drafted.
  • Result: the engine matches the key exactly: CardDemo 558/558, CBSA 410/410, zopeneditor 138/138.

Checks

  • Golden masters: only new Job Flow blocks.
  • Tests: full suite passes locally (11,216 passed). The ruff, mypy, dead-key and X-Ray checks are clean; the dead-key audit allowlists the JCL operand keywords parsed from source.

🤖 Generated with Claude Code

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

Base automatically changed from feat/vsam-defs-3455 to main September 24, 2026 11:03
…ow (#3451)

dataset_data bound each step's DDs to resolved DSNs, but not the job flow:
step order, conditional execution, PROC calls, and whether a DD creates or
reads its dataset -- what a batch data-flow DAG is built from.

New channel job_flow_data (core/job_flow.py), one row per JOB / EXEC step /
DSN DD:
- JOB with its COND=; STEP with its ordinal in its job or PROC, PGM= or PROC=
  (or positional), COND= as written, the enclosing IF conditions (ELSE as
  `NOT (...)`, nesting joined with AND) and the PROC it belongs to;
- DD with its DSN (generation stripped), DISP status (NEW / OLD / SHR / MOD;
  NEW when a DSN has no DISP) and GDG generation (+1 / 0 / -n). Proc-step
  override DDs (`//PRC001.FILEIN DD`) and IF / ELSE / ENDIF, which the dataset
  reader does not keep, are read by the channel's own statement reader;
  unnamed concatenation DDs take the name above them.

galaxy_ir: EngineJobFlow / EngineFile.job_flow and
- job_steps(): each job's steps in order, PROC calls expanded into the
  procedure's steps (in-stream, or the cataloged member -- .prc preferred);
- job_dataset_flow(): creating DDs (DISP NEW / MOD) joined to reading DDs
  (SHR / OLD) of the same dataset -- resolved DSN, generation dropped -- within
  a job only when the reader's step is later. DISP decides, not the
  generation: a later step's X(+1),DISP=SHR reads what the job created.
  Scheduler order is not in the repository; cross-job edges are candidates.

CardDemo: 56 jobs, 137 steps, all 9 PROC calls expanded, 22 conditional steps,
44 dataset producer -> consumer edges (31 cross-job, e.g. UNLDPADB -> LOADPADB).
CBSA: 46 jobs, all 90 PROC calls expanded (its DSNs stay symbolic, so no edges).

Ground truth: an independent reader (add-job-flow) and a scored field "JCL job
flow" (drafted). Engine matches the key exactly: CardDemo 558/558, CBSA
410/410, zopeneditor 138/138. Golden masters: new Job Flow blocks only.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017ZsVaAkb86P5r5JXDC2Y9g
@squid-protocol
squid-protocol merged commit 741c633 into main Sep 24, 2026
31 checks passed
@squid-protocol
squid-protocol deleted the feat/jcl-job-flow-3451 branch September 24, 2026 12:01
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.

Mainframe fact channel: JCL job flow: step order, COND/IF, GDG and dataset producer/consumer across jobs

1 participant