gnucobol-mainframe-batch
Agent skill frombenchflow-ai/skillsbench
GnuCOBOL toolchain pointers for mainframe-style batch programs (LINE/RECORD SEQUENTIAL files, PIC clauses, cobc build flags).
How to install gnucobol-mainframe-batch
install gnucobol-mainframe-batch
# install the skillsbench pack with the skills CLI
npx skills add benchflow-ai/skillsbench# or add only this skill to Claude Code: copy the folder
tasks-extra/cobol-gl-batch-reconcile/environment/skills/gnucobol-mainframe-batch/
# into
~/.claude/skills/gnucobol-mainframe-batch/ (all projects)
.claude/skills/gnucobol-mainframe-batch/ (one project)
tasks-extra/cobol-gl-batch-reconcile/environment/skills/gnucobol-mainframe-batch/SKILL.md
Apache-2.0Full file1# GnuCOBOL mainframe batch23## Compile and run45```bash6cobc -x -free -o prog PROG.cbl7./prog8```910`-free` allows `*>` comments and free-form source. File names in `SELECT`11are resolved relative to the program's run directory.1213```cobol14SELECT DETAIL-FILE ASSIGN TO "TRAN.DAT"15 ORGANIZATION IS SEQUENTIAL.16```1718For 80-byte fixed-record tapes use `ORGANIZATION IS SEQUENTIAL` with19`RECORD CONTAINS 80 CHARACTERS` in the FD. Pad `WRITE` records to the20required length (e.g. `MOVE SPACES TO BAL-REC` before populating fields).2122## PIC and signed amounts2324When a tape stores sign and magnitude in separate positions (`PIC X` plus25`PIC 9(11)V99`), build a signed working-storage value before `ADD` /26`SUBTRACT`. Using only the unsigned magnitude in `EVALUATE` branches is a27frequent bug when debits and credits share the same magnitude field.2829`COMPUTE … ROUNDED` rounds half away from zero in GnuCOBOL (matches the30Python `Decimal` `ROUND_HALF_UP` behaviour). Use it when multiplying a31two-decimal amount by a four-decimal rate and storing into a two-decimal32field.3334## Debug loop35361. `cobc -x -free -Wall -o prog PROG.cbl`372. `DISPLAY` intermediate values for one or two records to confirm the38 posting math and any cross-file lookups.393. Reconcile against a short script that applies the task's posting rules40 to the same tape layout.4142## References4344- [GnuCOBOL programmer's guide](https://gnucobol.sourceforge.io/doc/gnucobol.html)45…
Excerpt shown under the repository's Apache-2.0 license.
