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.2

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.2
File Size Uploaded Provenance Actions
jcl_parser-2.2.2.tar.gz 231.8 kB With provenance Details for jcl_parser-2.2.2.tar.gz

Built distribution (wheel)

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

Total release size: 501.2 kB

Release files / jcl_parser-2.2.2.tar.gz

Download URL jcl_parser-2.2.2.tar.gz
Size 231.8 kB
Tags Source
SHA-256 checksum
How to use checksums
6c4dd258167c72b44102b91db1472798d22d0e5b57f97cb7bef1e0a9c77d6e47
BLAKE2b-256 checksum
How to use checksums
d4aa616d8d700039a5bb501fbdb3c8eab3ff78eb6ffad814eed6e65cdd0ffb4c
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 Nov 2, 2026.

Transparency log

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

Download URL jcl_parser-2.2.2-py3-none-any.whl
Size 269.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
387bc694b4b2460fa096a5aaa76b4d9a50575e2dfd1af2b997ab35bd115ad18f
BLAKE2b-256 checksum
How to use checksums
2ed77cccfe4ab4bb197f73283b18ae0280505faa989fc72bde38572173585c6f
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 Nov 2, 2026.

Transparency log

Security for jcl-parser 2.2.2

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.2.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 Nov 2, 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