# Cobol

> COBOL for mainframe and legacy business systems. Use for .cob files.

- Skill: `g1joshi/cobol` (Agent Skill)
- Install (CLI): `npx skillmds@latest add g1joshi/cobol`
- Raw SKILL.md: https://api.skillmd.com/api/skills/g1joshi/cobol/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: G1Joshi (https://skillmd.com/u/g1joshi)
- Updated: 2026-09-10
- Page: https://skillmd.com/skills/g1joshi/cobol

---


# COBOL

COBOL runs 70% of the world's business transactions. Modern COBOL (GnuCOBOL 3.2 / IBM Enterprise COBOL) supports **JSON**, XML, and Object-Oriented features.

## When to Use

- **Mainframes**: The backbone of banking/insurance systems (CICS/IMS).
- **Legacy Migration**: Moving logic to Linux/Cloud using GnuCOBOL.
- **Decimal Arithmetic**: Native fixed-point math (`PICTURE 9V99`) is unmatched for currency.

## Core Concepts

### Divisions

`IDENTIFICATION`, `ENVIRONMENT`, `DATA`, `PROCEDURE`.

### Picture Clause

`01 SALARY PIC 9(5)V99`. Defines data layout precisely.

### PERFORM

The main control flow loop.

## Best Practices (2025)

**Do**:

- **Use GnuCOBOL**: For local development on Mac/Linux.
- **Use `VS Code`**: With the `bitlang.cobol` extension.
- **Unit Test**: Use `COBOL Check` or `ZUnit`.

**Don't**:

- **Don't use `GO TO`**: Use `PERFORM` and structured programming.

## References

- [GnuCOBOL FAQ](https://gnucobol.sourceforge.io/faq/)

