# Upgrade a COBOL Dependency and Fix Breakage with Atlas in 2026

> Atlas empowers COBOL developers to upgrade major library versions and automatically repair compile and test failures by directly interacting with `GnuCOBOL cobc` and `COBOL Check`.

In 2026, COBOL developers can leverage Atlas to efficiently upgrade a dependency to a new major version, automatically repairing every compile and test failure it causes by interacting directly with `GnuCOBOL cobc` and `COBOL Check`. Atlas drives the package manager through `bash`, reads real compiler output, and fixes callsites with its `edit` tool, ensuring your `IDENTIFICATION`, `DATA`, and `PROCEDURE` divisions remain consistent and correct.

## Key takeaways

- Atlas drives `GnuCOBOL cobc` for COBOL dependency upgrades and compilation.
- `webfetch` retrieves official release notes for accurate COBOL breaking change fixes.
- `edit` and `lsp` tools precisely repair `PROCEDURE DIVISION` and `DATA DIVISION` code.
- `COBOL Check` test failures are iteratively resolved by Atlas.
- Unified diffs and `git` integration provide full control over COBOL code changes.

## How Atlas upgrades COBOL dependencies and resolves compilation errors

Upgrading a COBOL dependency to a new major version often introduces breaking changes, but Atlas streamlines this process in 2026. It uses `bash` to run `GnuCOBOL cobc` for package management, capturing all output, even if it exceeds 100 lines, to identify compilation errors.

Atlas initiates the dependency upgrade by executing the relevant `GnuCOBOL cobc` command via its `bash` tool. For instance, if a new version of a utility library is available, Atlas would run a command like `bash -c "cobc --install-library new-utility-v2.0"`. The full output from this operation, including any warnings or errors from the package manager, is captured. If the output is extensive, exceeding typical terminal buffer limits, Atlas saves it to a file, which you can then `read` to understand the initial state of the upgrade. This ensures that Atlas has a complete picture of the changes and any immediate conflicts before proceeding to fix the codebase. Atlas then uses this output to identify which `COPY` members or `PROCEDURE DIVISION` paragraphs are affected by the new library version, preparing for targeted repairs.

## Accessing COBOL library release notes for breaking changes

To accurately fix breaking changes after a COBOL dependency upgrade, Atlas fetches the library's release notes using its `webfetch` tool. This ensures that fixes align with the actual changes, preventing guesswork and saving developers significant time in 2026.

Before attempting any code modifications, Atlas uses its `webfetch` tool to retrieve the release notes or changelog for the newly upgraded COBOL library. For example, if `new-utility-v2.0` was installed, Atlas would `webfetch` its documentation to understand the specific breaking changes, deprecated features, or new API signatures. This crucial step provides context for the subsequent `edit` operations. By having the official documentation, Atlas can ensure that its proposed fixes, such as adjusting `CALL` statements or `PICTURE` clauses in `MYPROG.cbl` or `COPYLIB/MYCOPY.cpy`, correctly address the library's new requirements rather than making assumptions. This proactive approach, informed by real-world documentation, significantly improves the accuracy and efficiency of the repair process for your COBOL codebase.

## How Atlas fixes COBOL compile and test failures

Atlas systematically addresses COBOL compile and test failures by leveraging `GnuCOBOL cobc` and `COBOL Check`. It iteratively builds the project, identifies errors, and uses its `edit` tool to apply precise fixes, often inspecting new signatures with `lsp` in 2026.

After fetching release notes, Atlas begins the iterative process of fixing the COBOL codebase. It first attempts to compile the project using `bash -c "cobc -x -o MYPROG MYPROG.cbl"`. Atlas reads the compiler output to identify specific errors, such as `PIC` clause mismatches or incorrect `CALL` parameters. For each error, Atlas uses its `edit` tool to modify the relevant `PROCEDURE DIVISION` or `DATA DIVISION` entries in files like `MYPROG.cbl` or `SUBPROG.cbl`. If a new signature is required, Atlas can use the `lsp` tool's `goToDefinition` operation to inspect the updated `COPY` members or `CALL` targets within the upgraded package, ensuring the `edit` is accurate. Once compilation is clean, Atlas runs the `COBOL Check` test suite with `bash -c "COBOL Check --test-suite=TESTS/MYTEST.tst"`. Any test failures are similarly analyzed, and Atlas uses `edit` to correct the logic in the `PROCEDURE DIVISION` until all tests pass. This cycle of `bash` (build/test) -> `read` (output) -> `edit` (fix) -> `lsp` (inspect) continues until the entire codebase compiles and all `COBOL Check` tests pass, ensuring a robust and functional upgrade.

## Reviewing and committing COBOL code changes with Atlas

Atlas ensures safety and developer control throughout the COBOL dependency upgrade process by presenting a unified diff for every file edit. Before writing any changes, developers must approve the modifications, maintaining oversight of their `IDENTIFICATION` and `DATA` divisions in 2026.

Every modification Atlas proposes, whether to a `PROCEDURE DIVISION` in `MYPROG.cbl` or a `PICTURE` clause in `COPYLIB/MYCOPY.cpy`, is presented as a unified diff for your approval. This allows you to review the exact changes Atlas intends to make, ensuring they align with COBOL's fixed-format column rules and your project's coding standards. Atlas also snapshots file changes as `git` patches, providing a robust rollback mechanism if any approved change introduces unforeseen issues. Furthermore, Atlas connects to your `git` repository, reading branches, status, and diffs. Once you are satisfied with the fixes, Atlas can stage the changes and create a commit on your behalf, complete with a descriptive message, streamlining the version control process for your COBOL codebase. This permission-gated approach, combined with transparent diffs and `git` integration, gives you complete control over the dependency upgrade and its impact on your forty years of batch logic.

## Steps

1. Run Atlas in your COBOL project directory where `MYPROG.cbl` and `COPYLIB` members reside.
2. Execute `bash -c "cobc --upgrade-package my-dependency-v2.0"` to upgrade the COBOL library and capture the full output.
3. Use `webfetch` to retrieve the release notes for `my-dependency-v2.0` to understand breaking changes.
4. Compile your COBOL programs with `bash -c "cobc -x -o MYPROG MYPROG.cbl"` and `read` the compiler output to identify errors.
5. For each identified error, use `edit` to modify the `PROCEDURE DIVISION` or `DATA DIVISION` in affected `.cbl` or `.cpy` files, using `lsp` to inspect new signatures if needed.
6. Re-run `bash -c "cobc -x -o MYPROG MYPROG.cbl"` until compilation is clean.
7. Execute `bash -c "COBOL Check --test-suite=TESTS/MYTEST.tst"` to run your COBOL Check tests.
8. For any failing tests, use `edit` to correct the logic in the `PROCEDURE DIVISION` until all tests pass.
9. Review the unified diff of all changes proposed by Atlas, ensuring adherence to fixed-format column rules.
10. Approve the changes and let Atlas stage and commit the fixes to your `git` repository.

## FAQ

### How does Atlas handle COBOL copybooks during a dependency upgrade?

Atlas reads your `IDENTIFICATION`, `DATA`, and `PROCEDURE` divisions, including every `COPY` member it pulls in. When a dependency upgrade affects a `COPYLIB/MYCOPY.cpy` member, Atlas uses its `edit` tool to modify the relevant `PICTURE` clauses or data structures within that copybook, ensuring consistency with the new library version.

### Can Atlas explain COBOL paragraphs before making changes?

Yes, Atlas can explain a `PROCEDURE DIVISION` paragraph in plain English before it touches it. This allows you to verify its understanding of `PIC` clauses, `CALL` statements, and batch logic, ensuring its proposed changes are accurate and align with your COBOL codebase's intent.

### How does Atlas ensure COBOL code formatting is maintained after edits?

Atlas allows you to review the diff against the fixed-format column rules before you approve any changes. While Atlas focuses on functional fixes, you can integrate `Z Open Editor formatter` through a plugin or run it manually via `bash` after Atlas's edits to ensure formatting compliance.

### What if the COBOL compiler output is very long during an upgrade?

If the output from `GnuCOBOL cobc` exceeds typical terminal limits, Atlas automatically saves it to a file. You can then use the `read` tool to inspect the full compiler output, ensuring no error messages or warnings are missed during the dependency upgrade process.

### How does Atlas handle permissions for running COBOL commands?

Every Atlas tool call, including compiling with `cobc` under GnuCOBOL and running `COBOL Check` test cases, is permission-gated. Atlas will ask for your approval before executing these commands, giving you full control over what runs in your COBOL environment.

### Can Atlas work with local COBOL code embeddings?

Yes, Atlas can build its code index with local Ollama embeddings, keeping your COBOL code, including `IDENTIFICATION`, `DATA`, and `PROCEDURE` divisions, off third-party servers. This ensures your proprietary batch logic and `PIC` clauses remain secure and private during analysis.

### How does Atlas help with reviewing COBOL changes before committing?

Atlas computes a unified diff for every file edit and surfaces it for approval before writing. It also reads `git` branches, status, and diffs, and can stage and create commits on your behalf, providing a clear audit trail for all COBOL dependency upgrade fixes.

---

Canonical HTML: https://runatlas.sh/resources/stacks/upgrade-a-dependency-and-fix-the-breakage-in-cobol
Source of truth: aeo_pages row `/resources/stacks/upgrade-a-dependency-and-fix-the-breakage-in-cobol` (segment: Stacks) (this file is generated from it, never hand-edited).
Licence: Atlas is proprietary with a free core. It is not open source and there is no public source repository.
