- By Joe Barr -
Not long after seeing KOBOL mentioned in an online news story, I was visiting theKompany.com to take a look. That's right, KOBOL. As in Common Business Oriented Language. Echos of Amazing Grace, punched cards, and Gene Amdahl. It was strange to see a classical batch offering from the master of object-oriented rock 'n' roll, Shawn Gordon.
Speaking of classical batch, batch processing is about all you can do with KOBOL. Because other than displaying messages at the console, there isn't much interactivity available. At least not yet. But murmurings on the KOBOL mailing list indicate there may be a GUI in KOBOL's future.
KOBOL is pretty bare-bones in its current form, but the price is low. Microfocus, long the acknowledged king of COBOL for personal computing, goes for about five large. It cost me $39.95 for the download version of KOBOL. You can download a free evaluation copy of KOBOL from this page, and the current version is 1.0.2.
Installation in Linux -- Windows 98 through XP are also supported -- is no more involved than decompressing the download file and running the install script. Once that is done, entering
KOBOL from the command line brings up the KOBOL IDE seen below.
It's been a few years -- five to be exact -- since I've coded in COBOL. So one of the first things I needed as I played in KOBOL's IDE was a manual. A COBOL language manual. But there isn't one included. The KOBOL "manual" includes some important information, but it is hardly more than a README. And its goal is not to provide a handy reference for writing COBOL code, in any case.
That's OK. I knew I could find some COBOL source code laying around on the Internet, so that's exactly what I did. When I tried to compile the first sample program I found and saved, however, the IDE threw a fit. It wants line numbers in columns 1 through 6, if you please. The sample code had no line numbers at all.
I did manage to tinker with some of the example code, as well as a program sent on the KOBOL mailing list for debugging. I also learned on the mailing list that it takes a little trick to properly read/write lines of text. I created an input file using vi that looks something like this:
1352 06/03/02 017276 ACE PLUMBING
1353 06/03/02 008290 PETS R URS
1354 06/04/02 001355 DAILY TIMES
1355 06/04/02 021912 AUTO REPAIR CENTER
1356 06/04/02 007422 BIG DADDY'S RESTAURANT
1357 06/05/02 042032 ELECTRIC COOP
1358 06/05/02 003872 DEATH STAR PHONE CO
In my KOBOL source code, I defined the file as:
000230 SELECT INFILE ASSIGN TO "input".
000305 FD INFILE
000306 RECORD CONTAINS 50 CHARACTERS
000307 LABEL RECORDS ARE STANDARD.
000308 01 IN-REC.
000309 05 FILLER PIC X(50).
The output file was similar. But the point is that because of the way KOBOL currently handles the newline character, the input gradually drifted off -- byte by byte -- from matching up with the input records. Shawn Gordon, founder of theKompany.com and chief architect of KOBOL, posted a workaround for the problem. His suggestion, modified to fit the example above, is to create and export an alias for "input" in your shell as in:
It works. Gordon notes that future releases of KOBOL will allow files to be declared as LINE SEQUENTIAL, so the workaround won't be necessary. It is heartening to see Gordon and his developers participating on the KOBOL mailing list to address customer worries, questions, and concerns.
The more I hacked around with the code, the more I found that I needed a programming manual for the tool. It's been years since I've seen my IBM mainframe COBOL books, and although I still have a handy copy of Rodney Zak's tome on Z80 programming, unused now for 20 years, I couldn't find anything at all to help me with COBOL.
It's not so much that I need the manuals in order to learn how to write COBOL code, it's because I don't remember what was an IBM (or other vendor's) extension to COBOL, which KOBOL wouldn't claim to support, and what was part of the ANSI standard, which they do claim to support. I would rank the need for a KOBOL programming manual right up there at the top of the "needs" list, and I hope theKompany responds. It would very definitely make the product more usable.
The second most needed enhancement to KOBOL, to my way of thinking, is the ability to more gracefully interact with the user. This may be coming down the road as a "plug-in." I asked Gordon if there were plans for a "screen painter" for KOBOL and he replied that they had something in mind that goes far beyond a mere "screen painter." That's fine. But the lack of even rudimentary screen handling is another shortcoming that limits what can be done with KOBOL today.
At this point, KOBOL's strength is its IDE. It's fast, fairly intuitive, and it lets you do editing, compiles, and test runs from within. I'm sure it has other worthwhile attributes as well, but I haven't yet had time to fully explore them. I'm more used to using a chisel to write COBOL than an IDE, anyway.
I don't know where I picked up the idea, but after a few days on the mailing list I was under the impression that KOBOL had started life elsewhere and then had come under theKompany.com's umbrella. This is not the case, however. Open COBOL, another PC COBOL project, is a continuation of Tiny COBOL, and like its predecessor it converts COBOL source to C prior to compiling. KOBOL follows a similar strategy, but uses C++ instead of C. Gordon said he actually began the KOBOL project before founding theKompany.com.
The bottom line is that you can get real work done with KOBOL today, but it isn't a finished, polished, or mature product just yet. It's an important product to Gordon, however, and that bodes well for its future. Gordon told me that he has always wanted KOBOL to be as easy to use as VB (Visual Basic), except with a COBOL syntax. It's not there yet, but the foundation is in place.