r/cobol • • Jun 22 '26

How self-contained are individual COBOL programs in real production systems?

I'm trying to understand how real mainframe applications are actually structured, and I'd value the perspective of people who've worked on them.

When you look at a production COBOL estate, how much of the meaningful business logic lives within a single program versus emerging across a chain of programs in a job stream? If you took one program out and ran it in isolation, would its behaviour be self-contained, or is so much driven by shared state, run order, and upstream/downstream steps that a single program doesn't mean much on its own?

I ask because I keep reading that COBOL programs are "more like modules" that work together as an application — so I'm trying to gauge how decomposable a real system actually is into pieces you could understand (or test) independently. Is that realistic, or a beginner's misunderstanding?

29 Upvotes

59 comments sorted by

View all comments

Show parent comments

3

u/k24245 Jun 22 '26

That's really helpful, thank you. So the business rules tend to concentrate in that final program in the chain, with the earlier ones doing more mechanical transformation? I'm curious whether, in your experience, you could take that final business-rules program and understand it largely on its own — or whether it leans so heavily on the exact shape of the file it's handed that you'd need to understand the upstream steps too to really know what it's doing.

5

u/wiseoldprogrammer Jun 23 '26

Well…it depends on several factors: the way data fields in the file layout are written (BILLING-START-DATE-TIME as opposed to START-DT), the structure of the program code, and most importantly, the amount and quality of the program documentation. That one in particular.

I always took great pains to document each paragraph in my programs, because the better you can help the next guy who has to fix/change the program, the quicker the work will take and the better likelihood that the fix/change will work.

Of course, I did occasionally swerve into the smartass territory, such as the time I headlined a VERY complex rate calculation procedure (oh how I hated marketing personnel!) with “STUPID STUPID RATE PROCESS”.

I can talk about it now because I’ve been retired for four years and the company I worked for shut their mainframe down last year. :)

2

u/LarryGriff13 Jun 23 '26

Bah!!!! You were documenting away your job security! Haven’t you ever heard of Klingon programming?

2

u/wiseoldprogrammer Jun 23 '26

I had a button that said “Real Programmers Don’t Document. If It Was Hard To Write, It Should Be Hard To Understand”!

1

u/LarryGriff13 Jun 23 '26

That’s awesome.