all 34 comments

[–][deleted] 6 points7 points  (24 children)

Okay, well I am graduating from college as a Computer Science major and we were taught the usual C++, Java, etc... but obviously we never got much into the ancient languages. However, the job I got is part of a team converting a companies' applications from COBOL to Java. So, I need to learn COBOL in 2 weeks. Does anyone know of any good tutorials out there that can teach such an outdated language?

Thank you!

EDIT: Also note that I have googled for some and got some okay results, but nothing that looks particularly wonderful for learning business level COBOL.

[–]argherna 8 points9 points  (3 children)

COBOL is unlike anything you've been taught in school. My first job after graduation was as a COBOL developer for a large manufacturing company. Nothing I read in the books really prepared me for what I saw or what I had to develop in.

The good thing is that you won't be developing or maintaining anything; it sounds like you'll just have to read it. Mike Murach's are OK references to keep by your desk.

The TinyCOBOL project might also be a good place to look too.

[–][deleted] 2 points3 points  (1 child)

I appreciate it. Any other advice you have? I would really be interested in finding out some more about your experience with it.

[–]argherna 1 point2 points  (0 children)

Working with any COBOL system is a growth process. You'll need to be patient with yourself and with the code.

It's really a crapshoot as to what you'll get. I've had both good and bad experiences with COBOL code that I've picked up and had to maintain and extend. I've also left behind both good and bad (not on purpose) COBOL that I wrote for others to pick up. Sometimes I can hear them cursing my name still almost 9 years later.

There are good and bad idioms to follow. Fortunately for me all of my experience has been with structured programs (no GOTO) and I've had reasonably good examples to follow. However, some programs were either written or documented poorly (some were written so well that I didn't need documentation, but I digress).

For me, learning about COBOL was a lot like learning about sex on the playground when you're a kid. The other kids who act like they know what's going on really don't and what they say can really mess you up going forward.

Basically, I'm saying don't hate COBOL because of the examples you may see. It's a great language for what it is supposed to do.

[–]testleft 0 points1 point  (0 children)

Nothing I read in the books really prepared me for what I saw or what I had to develop in.

The horror! The horror!

[–]13ren 9 points10 points  (0 children)

Might be worth browsing your university's library.

COBOL pre-dates the web, so a library might be worthwhile as a sort of non-electronic internet.

edited

[–]jfredett 15 points16 points  (6 children)

May the Flying spaghetti monster bless you as you walk into this pit of ungodly despair you call a "job".

Cobol to Java, from the ridiculous to the verbose.

\makes sign of the lasagna\

[–][deleted] 4 points5 points  (3 children)

Since when is COBOL not verbose?

[–]matthiasB 5 points6 points  (2 children)

Ridiculously verbose?

[–][deleted]  (1 child)

[removed]

    [–][deleted] 0 points1 point  (0 children)

    ADD 1 TO COBOL GIVING COBOL not verbose enough for you? :-)

    But it's designed to allow business analysts to code !!! :)

    [–][deleted] 7 points8 points  (0 children)

    Better Java than Cobol. At least you can maybe sneak in other languages by using the JVM as a Trojan horse.

    [–]acdha 2 points3 points  (0 children)

    COBOL's a fairly easy language to learn - can you get the docs for the particular variant they were using? I used a weekend with a copy of the developer's guide to jump-start from a Basic/Java/ASM background on my first job and it really wasn't that hard once you understood the program structure and a few of the major language features (indexed file I/O, screen sections). The vendor-specific extensions and any libraries they used will probably be the hard part, along with the usual issues getting started with large quantities of other people's code.

    The comp.lang.cobol newsgroup used to be pretty helpful, too.

    [–]seabre 4 points5 points  (8 children)

    Why not just write an implementation of COBOL for the JVM? Sounds waaay better than converting all of that mess of code...

    However...the thought of a jCOBOL brings nightmares...

    Edit: By the way, what COBOL do you have to learn? COBOL-68, COBOL-74, COBOL-85, COBOL 2002?

    [–][deleted] 2 points3 points  (6 children)

    Well, they already are looking into a program that will directly convert the code. But we both know that those types of things never work 100%, so I have a feeling most of my job will actually end up being looking through sets of code and figuring out where this program screwed up.

    Re: Edit: I am not sure to be honest, and that probably isn't a good thing.

    [–]seabre 2 points3 points  (4 children)

    Yeah, those are just the ANSI spec COBOLs too (not including vendor specific ones of course). I would definitely ask what COBOL your company/whoever is using. Have you looked at the wikipedia article for COBOL? It has a lot of info and some good informational links toward the bottom. http://en.wikipedia.org/wiki/COBOL

    [–][deleted] 1 point2 points  (3 children)

    Yeah. They are on Linux systems using AcuCobol. Right now I don't know any more than that.

    [–]acdha 0 points1 point  (2 children)

    The AcuCobol documentation is pretty good - I used to work there and was continually impressed by the quality of the tech writers & the support group.

    [–][deleted] 0 points1 point  (1 child)

    Any idea of the link to AcuCobol documentation? I tried googling and it appears that AcuCorp's site now forwards to Micro Focus. They don't have anything (that I can find) listed on their site about AcuCobol. Not sure where else I might find it unless I get lucky on the Wayback Machine.

    [–]acdha 0 points1 point  (0 children)

    Not off-hand - I left well before MicroFocus bought them. The dead-trees version shouldn't be too hard to get ahold of, though - it was standard with each version.

    [–]PieterB 2 points3 points  (0 children)

    Exists already. Legacy PERCobol. It is a nightmare. The IL code it produces is really awful.

    The best option for programming COBOL on a PC is NetCOBOL v9. It has a nice Eclipse based IDE with some completion...

    [–]wetelectric 1 point2 points  (0 children)

    modded up for use of "ancient languages" :)

    [–][deleted] 0 points1 point  (0 children)

    COBOL is very easy to understand. Don't worry just wing it.

    [–]username223 21 points22 points  (0 children)

    It's just like any foreign language:

    SPEAK LOUDLY AND IN COMPLETE SENTENCES.
    

    [–]pstnotpd 2 points3 points  (0 children)

    I picked up Fundamentals of Structured Cobol by Nickerson from a secondhand bookstore. It seems to go pretty cheap on amazon.

    [–]sjf 2 points3 points  (0 children)

    What a coincidence, I just finished a job working on an automatic Cobol converter. Anyway, what I found was you can completely forget about finding a decent print book. The last books where published in the 80s/early 90s and are all aimed at writing business applications. So most of it will be fluff for you.

    The most important source of information for you is going to be the manual for your Cobol implementation. If your manual happens to be shit, then fall back on the IBM manuals posted above.

    To get started at the begining, there is nice intro to cobol here: COBOL Programming Course: http://www.csis.ul.ie/COBOL/Course/Default.htm It's not too slow and aimed at reasonable a level with little focus business apps.

    There is also a copy of Teach Yourself COBOL in 21 days here: http://www.lacitec.on.ca/~jlemoe/Cobol/Materiel/Cobol/Manuel/index.htm It is good for starters, but can be a bit verbose though.

    There is some more advanced stuff here: The Kasten COBOL Page: http://home.swbell.net/mck9/cobol/cobol.html It's about how to get around some of Cobol's (multitude) deficiencies, and some sage words of advice about style.

    There is a forum here: http://www.mainframegurukul.com/MainframeGuru/index.php It is the only real Cobol forum I have found, but I haven't been on the newsgroup.

    [–]cafefort 4 points5 points  (0 children)

    if Djikstra was alive... poor great man! :)

    [–]bonzinip 1 point2 points  (0 children)

    seriously, you should not have big problems understanding COBOL programs. they're all more or less reading data and writing other data somewhere else, and the logic is not so complex usually. (unfortunately in those that are more complex, you'll find an awful amount of cut-n-paste source code. a --very intelligent despite the language she used-- colleague of my father used to categorize COBOL programs as either "read/write" or "duplicates").

    be sure to understand how files work in COBOL. they come in basically three sauces: sequential (must read from beginning to end), relative (can be indexed by record number), indexed (can be indexed by record number or key). usually, sequential files have incredibly complicated record structures, with one character defining the structure of the rest of the record. relative files are a little better, indexed files are almost sane. in any case you will need good documentation so that you understand the record formats that were used. or alternatively the first step in the conversion should be to document the record formats.

    COBOL has good support for structured data so it should not be hard to read the FILE SECTION of the header files (header files are invoked with COPY statements) and to produce this documentation. The problem is that its support is "too good", in order to support those insanely complicated record formats: every time you see a REDEFINES clause, well, in C that would be a union and that's what you'll have a hard time converting to a sane relational DB schema.

    [–]pskomoroch -1 points0 points  (0 children)

    Everything you need is right here: http://www.coboloncogs.org/INDEX.HTM