Skip to main content

jcl-parser

Python library for parsing IBM z/OS JCL (Job Control Language) into structured Job, Step, and DD objects. Supports PROC expansion, validation, lint rules, SQL detection, and dataset lifecycle analysis.

Python 3.10+ Coverage License: AGPL v3

Install

pip install jcl-parser        # from PyPI
pip install -e ".[dev]"       # from a checkout, with the dev tools

Requires Python 3.10+. No runtime dependencies.

Quick Start

from pathlib import Path

import jclparser

job = jclparser.parse_jcl(Path("PAYROLL.jcl"))  # a str is always JCL text, never a path
print(job.name)
for step in jclparser.iter_execution_steps(job.steps):  # also walks IF/THEN/ELSE blocks
    print(step.name, step.program or step.procedure)

exploded = jclparser.explode_job(job)  # PROC expansion is a separate call
errors = jclparser.validate_jcl(
    Path("PAYROLL.jcl"), level="structure"
)  # list[ParseError]
print(job.to_json(indent=2))  # schema: jclparser.JOB_JSON_SCHEMA

CLI:

jcl-parser FILE steps          # list all steps
jcl-parser FILE --validate     # validate JCL
jcl-parser FILE lint           # run lint rules
jcl-parser FILE --json         # full parse result as JSON (job.to_dict())
jcl-parser --json-schema       # JSON Schema of that document
jcl-parser DIR                 # cross-job dataset lineage of a directory of jobs
jcl-parser DIR lineage mermaid # ... as a Mermaid graph (or `dot`)
jcl-parser DIR lint --sarif    # lint every job of a directory, as SARIF
jcl-lint jobs/ --fail-on warning --format sarif -o jcl.sarif   # CI / pre-commit

Lint in CI

Configure the rules in pyproject.toml, and switch one off for one statement with a comment:

[tool.jcl-parser.lint]
ignore = ["JCL-LINT-002"]
fail-on = "warning"
[tool.jcl-parser.lint.severity]
"JCL-LINT-004" = "warning"
//* jcl-lint: disable=JCL-LINT-001
//MASTER   DD DSN=PROD.MASTER.FILE,DISP=SHR

pre-commit (.pre-commit-config.yaml):

- repo: https://github.com/landparty/jcl-parser
  rev: v2.2.0   # first release with the hook
  hooks:
    - id: jcl-lint

GitHub Actions (findings appear in code scanning):

permissions:
  security-events: write
steps:
  - uses: actions/checkout@v4
  - uses: landparty/jcl-parser@v2.2.0   # first release with the action
    with:
      paths: jcl
      glob: "**/*.jcl"

Commands

# Tests
pytest
pytest -m unit

# Lint / format / type-check
ruff check . && ruff format .
python scripts/mypy_ratchet.py   # mypy strict against the known-error baseline, as CI runs it

# Vendor sync (after changes to jclparser/) — rm first: plain `cp -r` nests
# into dest/jclparser/jclparser/ and leaves stale files when dest exists
rm -rf ../backend/_vendor/jcl-parser/jclparser && cp -r jclparser/ ../backend/_vendor/jcl-parser/jclparser

Documentation

Full reference: .okf/index.md. Contributors: start with CLAUDE.md (commands, architecture, invariants) and .okf/development/invariants.md. Changes are listed in CHANGELOG.md (releases) and .okf/log.md.

License

GNU Affero General Public License v3.0 or later — Copyright © 2026 Samuel Dion. See LICENSE.

Metadata

Release files for jcl-parser 2.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for jcl-parser 2.2.0
File Size Uploaded Provenance Actions
jcl_parser-2.2.0.tar.gz 225.1 kB With provenance Details for jcl_parser-2.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for jcl-parser 2.2.0
File Interpreter ABI Platform Actions
jcl_parser-2.2.0-py3-none-any.whl Python 3 none any Details for jcl_parser-2.2.0-py3-none-any.whl

Total release size: 487.4 kB

Release files / jcl_parser-2.2.0.tar.gz

Download URL jcl_parser-2.2.0.tar.gz
Size 225.1 kB
Tags Source
SHA-256 checksum
How to use checksums
4bb2cba8b9c8ae66133595a2f5d15457210baa01057300853fc4bbe982435903
BLAKE2b-256 checksum
How to use checksums
0c38385bd6c589824d1e759f9e14bb9a3eff12d47cc1c32fc9cdc106bc4e3970
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

Release files / jcl_parser-2.2.0-py3-none-any.whl

Download URL jcl_parser-2.2.0-py3-none-any.whl
Size 262.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bb70491f1163c238d817aea6c60eea7b760bb9e79375a023550be103fb324903
BLAKE2b-256 checksum
How to use checksums
ea7f348c412d20970aaa71f43d3080396e14708253b9d000a0241d120a8891d2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

Security for jcl-parser 2.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for jcl_parser-2.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page