COBOL, A Short Visit
on December 06, 2006 @ 04:58 AM

I wrote some COBOL today. I can’t say it was fun, enjoyable or even breath taking. It was more of a “oh my gosh, I’m so glad we have languages better COBOL these days!”.

I was working with a vendor who runs a data extract program from a COBOL program. We needed to utilize a non-printable whitespace character as a field delimiter. They didn’t know how to do that since COBOL treats all whitespace equally, as spaces. I was hoping COBOL would treat \t literals as actual tabs, but it doesn’t.

So I ended up with my sample program:

1
2
3
4
5
6
000100 IDENTIFICATION DIVISION.
000200 PROGRAM-ID. hello.
000300 PROCEDURE DIVISION.
000400 DISPLAY X'09'.
000500 DISPLAY "Hello World!".
000600 STOP RUN.

That X’09’ gave me my binary character for a tab! I can’t say I’d want to program in COBOL, but for a very short visit it was fun to read up on it, and write some sample programs. The above six-liner just happened to be the one I needed.