The Kasten COBOL Page

triceratops From one of the dinosaurs who still writes COBOL -- the language which is on the brink of extinction, and always will be -- welcome to my COBOL page.

Despite what you may have heard, this old fossil of a language can survive, thrive, and even coexist with those hairy little mammals who have been acting so smug and uppity.

Coding Guidelines

[ionic column] The COBOL Style Forum suggests ways to make your COBOL readable, well-structured, and bug-resistant. Not everyone will agree with me; I hope others will contribute their points of view.

Rewriting Spaghetti Code

[spaghetti] These pages describe a systematic approach to eliminating GO TOs and fall-through logic, even from the most tangled programs.

[Note: this section isn't complete yet. I still haven't finished all the pages on loops -- but I'm working on them. Really.]

Object Oriented COBOL

[OOC] Here's what I've learned so far about IBM's implementation of object-oriented COBOL.

Guerrilla COBOL

Do you suffer from C-envy? Would you like to try some of the tricks that are so common in C and other languages? You can. With a reasonably modern dialect of COBOL, and a little ingenuity, you can do almost anything that a C programmer can do:

[chip] Dynamic Memory Allocation

[hand] Pointer Variables

[globe] Global Variables

[environment] Environmental Variables

[structure] Data Structures

[block] Text Parsing Techniques

[gears] Finite State Machines

The Iron Laws of Software Development

[iron] I've never seen them fail on a non-trivial project.

My Credentials

I've been programming for a living since 1985 -- mostly in COBOL, mostly on IBM mainframes using OS/MVS COBOL or COBOL II. I'm also fluent in C and somewhat less fluent in C++. I've used a smattering of several other languages such as Fortran, Pascal, and Basic.

The point is not to brag -- I'm not looking for a job -- but to admit my limitations. Most of what I have to say applies to COBOL II. It's not the only dialect that matters, but it's what I know.

These pages are my credentials. Judge for yourself whether they make sense. If you don't know enough COBOL to judge for yourself, then my credentials are better than yours.

The Examples

I work for a major telephone company, on an application called JOCKEY. Many of the examples come from that world. If you're in the telephone business you'll recognize some of the jargon. If you're not, don't worry about it. My points should be clear enough anyway.

I could have based my examples on some generic made-up application like Payroll. But I don't know anything about payroll systems, and I couldn't make up anything very convincing.

In some cases it would have been useful to publish actual working programs, but unfortunately I can't do that. The code I write is proprietary and belongs to my employer. The code snippets on these pages are uncompiled and untested. Though I have stared at them long and hard, I have probably embarrassed myself somewhere. Please tell me about any blunders.

Linking to These Pages

If you link to my pages, please let me know. That way I can warn you if they get moved or renamed. Or go extinct.

Michael C. Kasten


Picture Credits | Other COBOL Resources | About These Pages | What's New

This page has been accessed Page Counter times since February 1, 1998.