In case anyone is wondering if something like this could ever be the "killer app" of COBOL that launches it into modern fame and glory, the answer is "oh god, no."
COBOL isn't a modern language by any stretch of the imagination. For example, advanced math is something that it's particularly bad at. Or do you want to sort some data? Yeah, COBOL will let you sort some data, only if you specify the damned file containing the unsorted data, the file that will hold the data while it's being sorted, the file that will contain the sorted data (http://www.tutorialspoint.com/cobol/cobol_internal_sort.htm). Want to sort an array into another array? Screw you.
However, there's one thing that COBOL is very bad at: unstructured text. Guess what 99% of the Web is?
For example, in their sample code they show this in the working storage section:
Guess what "pic x(90)" means? The "x" means it can contain any data (not just alphanumerics), but the 90 means it must be 90 characters long. In other words, if you have color=blue in your query string, "color" will be 90 characters long (probably padded with 85 spaces), and "blue" will be the same (probably padded with 86 spaces).
Thus, when someone else declares color as "pic x(80)" (note the 80 versus 90), even if the color submitted is "blue" for each, one might be 80 characters long and the other might be 90 characters long and if you don't like it, too bad. Have fun comparing them.
COBOL is still the world's most popular programming language, though, if you look at it in terms of lines of code. Sadly, COBOL programmers are aging and there are fewer devs to maintain their programs (I started hacking on COBOL when I was 30 and I was the youngest developer in my department!).
I work at a company that is in the middle of a massive COBOL -> Java migration project.
The core transaction processing system has 1.3 million lines of HP3000 COBOL that is pre-compiled to 13 million lines of Micro Focus COBOL, so that code can be compiled to run on UNIX hardware (using a mainframe emulator framework).
So although I'm not a COBOL dev myself, I deal with the issue you describe constantly. Want to give an inventory item an identifier that's longer than 36 characters? Too bad! That field in the legacy system is PIC X(36) so it will get truncated to that length if it's longer (and of course, padded with spaces if it's shorter, so there are lots of String.trim() calls in our Java code).
Damn it! I totally feel your pain. Migrating COBOL to Java has long been one of my pet peeves. The former is procedural with all variables being global and fixed-width and the later is OO (sort of) with lexical variables of variable size. The two do not mix and match well.
Trying to get away from COBOL is actually a three-way problem: technological (as we've alluded to), business (hey, we gotta stop using this shit!), and social (hey, I don't want to touch this shit!). Unfortunately, virtually every solution I've seen focuses on the business or technical issue in isolation, but ignores the others.
I've actually found a solution that solves all of the issues and would make new developers excited to work in COBOL shops, but it's on hold until some technical challenges are surmounted. Frustrating as hell!
Right, there's a huge impedance mismatch between COBOL and Java, but couldn't you say the same for any other modern PL? I don't see how migrating COBOL to Python or Clojure or Haskell would be much easier than migrating it to Java.
But yes, no one wants to touch the 30 year-old COBOL codebase with a ten foot pole. It's career kryptonite.
I'd be curious to learn about the solution you're describing for this problem, is it something you can disclose in any detail?
Whenever I read COBOL I am always amazed...well...that I can read it and get some gist of what is going on with relative ease.
I don't really want to participate in all the ceremony that goes into writing COBOL, but the end product is often more intelligible than code in some other languages I don't know.
COBOL (or perhaps these days Cobol, lower-case) just received a new edition of its standard last year. By far its most major overhaul was in 2002, with the introduction of OO and recursion.
Not to say that you should be quick to build your startup on COBOL, but the present language is pretty tolerable. Most of the COBOL that actually runs, I think, is 74-era code, however. That is certainly painful.
It could always be worse, however. It could be MUMPS.
Most places that has kept its code "up to date" seems to run on the 85 standard with some newer stuff that was added in 89. End-ifs and such wasn't part of the language until then. The companies that hasn't put that much love into their COBOL code usually runs some home brewed version of a earlier standard.
In case anyone is wondering if something like this could ever be the "killer app" of COBOL that launches it into modern fame and glory, the answer is "oh god, no."
COBOL isn't a modern language by any stretch of the imagination. For example, advanced math is something that it's particularly bad at. Or do you want to sort some data? Yeah, COBOL will let you sort some data, only if you specify the damned file containing the unsorted data, the file that will hold the data while it's being sorted, the file that will contain the sorted data (http://www.tutorialspoint.com/cobol/cobol_internal_sort.htm). Want to sort an array into another array? Screw you.
However, there's one thing that COBOL is very bad at: unstructured text. Guess what 99% of the Web is?
For example, in their sample code they show this in the working storage section:
Guess what "pic x(90)" means? The "x" means it can contain any data (not just alphanumerics), but the 90 means it must be 90 characters long. In other words, if you have color=blue in your query string, "color" will be 90 characters long (probably padded with 85 spaces), and "blue" will be the same (probably padded with 86 spaces).Thus, when someone else declares color as "pic x(80)" (note the 80 versus 90), even if the color submitted is "blue" for each, one might be 80 characters long and the other might be 90 characters long and if you don't like it, too bad. Have fun comparing them.
COBOL is still the world's most popular programming language, though, if you look at it in terms of lines of code. Sadly, COBOL programmers are aging and there are fewer devs to maintain their programs (I started hacking on COBOL when I was 30 and I was the youngest developer in my department!).