1. LandOffer
  2. Blog
  3. All articles
  4. COBOL Developer Portfolio: Show a Batch Job, Test Data, and Reconciliation

Job search

COBOL Developer Portfolio: Show a Batch Job, Test Data, and Reconciliation

Follow an actually compiled GnuCOBOL batch from fixed-width synthetic inputs to posted and rejected files, independent cent totals, I/O failures and bounded replay evidence.

9 min readLandOffer team

A useful COBOL developer portfolio lets a reviewer trace a batch input through validation, accepted and rejected outputs, and a reconciliation they can reproduce. Include the record layout, business rules, compiler command, return codes and expected totals. A zero return code alone cannot show that the program selected the right records, assigned them to the right accounts or preserved the expected cent amounts.

LandOffer publishes this guide. We compiled and ran the original synthetic example below locally with GnuCOBOL on macOS on October 23, 2026. It uses no customer data or mainframe access. The completed assets demonstrate application-level file handling and arithmetic, not z/OS operations, JCL scheduling or DB2 experience. Use that distinction when comparing recent roles on LandOffer.

An engineer follows a stream of record cards into separate posted and rejected trays, then checks a total ledger beside an adding machine.

Choose a small business rule a reviewer can inspect

This example is an invented two-account credit-and-debit batch. Account A001 starts with 10,000 cents and A002 with 25,000 cents. Each accepted credit adds its amount; each accepted debit subtracts it. A debit that would make its account negative is rejected. The account identifiers and transactions are synthetic teaching data, not real banking records.

The deliverable is deliberately small: one COBOL source file, an input contract, generated output files and an independent reconciliation runner. It has no interest calculation, currency conversion, fees, database integration or external payment action. Keep those exclusions beside the specification: a reviewer can assess the chosen rules without mistaking a two-account teaching batch for a banking system.

The Open Mainframe Project's current COBOL Programming Course page describes an open-source educational initiative with modern tooling. Learning materials can support your next steps, but access to a course and execution of this local batch are separate evidence. This project did not enter a hosted mainframe environment or complete that course's exercises.

The first completed asset is the authored batch and its public-safe test data. The second is the normal, exception and rerun reconciliation package. Both are actual local artifacts; their business context is invented. They provide different evidence: what the program implements, and how its observed outputs compare with the stated rules.

Make the input layout and rejection policy explicit

Every transaction is an 18-character ASCII line followed by a newline. It contains no delimiter or decimal point. The amount is seven numeric characters representing cents, so 0001234 means 1,234 cents, or 12.34 in the fictional currency convention. The code does not use binary floating-point money.

Positions Field Authored rule
1–6 Transaction ID T followed by five digits
7–10 Account A001 or A002
11 Direction C for credit; D for debit
12–18 Amount Seven digits; greater than zero

The batch also rejects a repeated ID already accepted in that execution, an overdrawn debit and an attempted 101st accepted record. Its ID table holds 100 accepted IDs. The cap is an explicit teaching constraint, not a claim of enterprise batch capacity.

Validation has a defined order. Length is checked before extracting fields. The numeric amount is counted in parseable input gross when the record has the correct length and the amount field contains digits. Structural and business checks then decide whether it can post. Duplicate detection applies to previously accepted IDs, not every rejected ID encountered.

A rejected line produces its input line number and a reason code. It does not produce a posted transaction or change an account balance. When a line has multiple defects, the first applicable rule determines the recorded reason; the report is not an exhaustive list of every defect on that line.

The completed input-contract file records these decisions. A reviewer can compare the field positions and rejection order with each fixture before tracing the source, rather than guessing the intended behavior from implementation details. If the intended business rule were “stop the whole batch on any invalid record,” this implementation would not satisfy it: the chosen policy continues after record-level rejections.

Show an actual compiler and executable run

GnuCOBOL's official site currently identifies version 3.2, released July 28, 2023, and lists macOS among supported platforms. We downloaded its source from GNU and built it into this article's dedicated local tool directory using the existing C compiler and GMP dependency. No global compiler installation or shell configuration was changed.

The resulting compiler reports GnuCOBOL 3.2.0. The official manual documents executable compilation with -x, free-format source with -free, and output naming with -o. Our actual compilation also enables warnings and runtime checks:

cobc -x -free -Wall -debug \
  -o batch batch.cob

Here cobc denotes the recorded task-local compiler path. The saved compile receipt contains the full command, compiler version, source hash, executable hash, diagnostics and return code. The final compile returned zero with no diagnostics. An earlier compile failed because a variable used a reserved word; that failure and its correction are retained rather than presented as a successful first attempt.

The Python runner invokes the compiled executable in disposable working directories. It supplies input files, captures program output and compares results with a separately written reference calculation. Python is not standing in for COBOL execution: the transaction validation, output writes, balances and totals are implemented in batch.cob.

Record this environment accurately on a résumé. “Compiled a GnuCOBOL batch locally” describes the evidence. It does not establish Enterprise COBOL compatibility, EBCDIC conversion, VSAM access, production scheduling or maintenance of an employer's mainframe application.

Completed normal run: reconcile records and integer cents

The normal input contains four transactions. A001 receives a 1,234-cent credit and a 101-cent debit. A002 receives a one-cent debit and a two-cent credit. Those small amounts deliberately include cent-level changes that should not disappear during formatting or arithmetic.

Account Opening cents Credits Debits Observed closing cents
A001 10,000 1,234 101 11,133
A002 25,000 2 1 25,001
Combined 35,000 1,236 102 36,134

All four records post and none is rejected. The reconciliation checks that received records equal posted plus rejected records. It separately checks the balance equation: 35,000 opening cents plus 1,236 credit cents minus 102 debit cents equals 36,134 closing cents.

Gross accepted amount is 1,338 cents, the sum of credit and debit magnitudes. Net movement is 1,134 cents. Keep those quantities distinct: comparing gross input directly with the change in account balances would incorrectly report a discrepancy even though the entries reconcile.

The reference calculation also compares every posted output line, including transaction ID, account, direction, original amount text and resulting account balance. A matching grand total can hide an amount assigned to the wrong account or an incorrect transaction ID; the line-by-line comparison checks those fields as well. Input-file hashes are checked after execution to establish that the tested batch did not rewrite its input.

This normal result is a completed observation, not a sample expected outcome left for the reader to obtain. The retained input, posted output and standard output let a reviewer repeat the calculation. They do not establish correctness for every possible record or a financial institution's accounting requirements.

A ledger balances accepted records against a separate exception tray, with cent counters and a magnifier highlighting why record counts and amount totals need distinct checks.

Completed exception run: account for what did not post

The mixed input repeats the four normal transactions and adds five problematic lines: a duplicate accepted ID, an unknown account, a nonnumeric amount, an insufficient-funds debit and a short record. The program receives nine lines, posts four and rejects five. Closing balances remain 11,133 and 25,001 cents because none of those five rejected lines posts.

The rejected output identifies line numbers and specific reasons: DUPLICATE, ACCOUNT, AMOUNT_FORMAT, INSUFFICIENT and LENGTH. The nonnumeric and short records cannot contribute a trustworthy monetary amount. They remain represented in the record-count reconciliation instead of being silently assigned a business value of zero.

For the records whose full amount fields are parseable, the numeric reconciliation is also explicit:

Mixed-run quantity Observed cents
Parseable input gross 102,621
Posted gross 1,338
Rejected parseable gross 101,283

The rejected parseable gross includes the duplicate's 1,234 cents, the unknown account's 50 cents and the insufficient-funds debit's 99,999 cents. Their sum is 101,283. Adding posted gross gives 102,621. This equation covers parseable magnitudes only; it does not repair or financially interpret the malformed lines.

Separate cases exercise an invalid ID, invalid direction, zero amount and overlength record. An empty file produces no transactions and preserves the opening balances. A capacity case supplies 101 one-cent credits: 100 post, one is rejected, and A001 closes at 10,100 cents. The saved results distinguish each validation reason and the 100-record capacity boundary. They do not test every amount, malformed byte sequence or operating-system failure.

Keep return codes, file statuses and replay separate

The job defines return code zero for a completed run without record rejections, four for a completed run with rejections, and twelve for a fatal I/O problem. These are this program's conventions, not a universal meaning for every COBOL job or scheduler. An operating procedure would need to decide which outputs are usable after each result.

Successful tested file opens and closes report status 00, while completed reads reach status 10. With input absent, the observed input-open status is 35 and the program returns twelve without creating output files. When the posted-output path is a directory, the observed open status is 37 and the program returns twelve. Keep those actual observations attached to this local environment.

The successful cases are each executed again in a fresh process against the same input. Posted files, rejection files, standard output and return codes match. The runner itself was also launched twice independently; both runs passed 46 assertions and produced byte-identical JSON results, with unchanged source hashes.

That replay starts from the same opening balances and recreates output files. It does not demonstrate exactly-once posting to a persistent ledger. Accepted-ID memory resets on restart. The implementation has no checkpoint/restart protocol, concurrent-run protection or rollback of partial outputs after a later I/O failure. A later persistent-ledger project would need explicit restart, duplicate-run and partial-output recovery designs, with separate tests before any stronger replay or recovery claim.

Package a contribution a reviewer can verify

The handoff includes the source, input contract, synthetic fixtures, compiler-build receipt, failed and successful compile records, raw outputs and completed reconciliation report. Run python3 run_lab.py from its report directory to compile and exercise the cases. The optional --workdir argument requires an absolute path and keeps an independent review's artifacts separate from the saved evidence.

Lead the portfolio explanation with one rule and follow its record through the actual output. Then show one rejected record and explain which checks still account for it. The reviewer can inspect the rule, exact input, output and comparison; a terminal screenshot alone would leave those business decisions and calculations unverified.

A truthful project description is: “Built and locally compiled a synthetic COBOL credit/debit batch; validated fixed-width records, produced posted and rejected files, and independently reconciled record counts and integer-cent balances across normal and exception cases.” Attach the environment and remaining restart limitations to that description.

Choose a target application role and compare its actual duties with those demonstrated behaviors. Use LandOffer's recent roles or your existing search to identify where business-rule implementation and batch testing matter, while keeping mainframe technologies you have not exercised clearly separate.

Download the worked example files

Download the curated educational companion. Read PUBLICATION-README.md after extraction for the public file layout, replay commands and requirements. This is an archival source-and-fixture companion with external runtime requirements; its dependency-based execution was not rerun for publication. The earlier local report and commands describe the original evidence environment; use the companion README for the portable layout. No whole evidence directory, credentials or compiler binaries are included.

Sources and Further Reading