COBOL

I have been looking at the COBOL language and have quite a few questions.


1. What the heck does PIC() do? I have seen it used for so much , but do not know what is is
2. Where are some good sites to learn COBOL that are not expecting me to use ancient and nonexistent compilers.
3. Is there any native way to get console input?
4. How do I import external code/libraries?
5. What is a good easy to setup/build compiler to get started with?


Thanks.
Well, I can't answer all of those questions (I don't code in COBOL myself) but after some searching I found GnuCOBOL (http://sourceforge.net/projects/open-cobol/)
the recommended documentation for it that includes a pdf (http://opencobol.add1tocobol.com/guides/)
another guide that's pretty old but also pretty complete here
(http://www.csis.ul.ie/cobol/)
and visual cobol which seems to be from a quick glance, still supported
Edit: Link was weird.
(http://www.microfocus.com/solutions/cobol/index.aspx )

Out of curiosity, why?
Last edited on
COBOL is still unfortunately in a ton of places. You can be paid a lot of money if you are good with COBOL.
Just really looked at how old Cobol is. Wow. And I thought that C was/is an old language. I suppose as long as the code is bug-free and there are some maintainers, there isn't really a problem with keeping it around. Still, there should be some point when people just move on.
Currently, all the people who were taught to program in cobol in school are retiring. Companies are willing to pay out the ass for young developers who can maintain their code. But eventually, the cost of maintaining will be greater than the cost of upgrading, and that's when cobol will fizzle out.
Cheraphy wrote:
But eventually, the cost of maintaining will be greater than the cost of upgrading, and that's when cobol will fizzle out.
That's not likely happen for the foreseeable future. COBOL is still heavily used on mainframes, and they aren't going anywhere.

@OP
PIC is called a picture clause and is used to describe a data field. For example PIC S9(5)v99 declares signed numeric storage to hold 7 digits with a decimal point though the data does not store the decimal point.
COBOL is still heavily used on mainframes, and they aren't going anywhere.

Mainframes are and have been on the way out. It's just a stubborn process.
@ResidentBiscuit
I don't believe that is true. There is a ton of code that would need to be rewritten, changed or recompiled. The cost of that alone would keep companies from switching to something else. There also isn't much hardware available (that I know of) that can handle the load mainframes do.
Your first point is why I said it's a stubborn process. Eventually people will migrate off of it, no matter how painful it will be. As for your second point, clusters of commodity hardware seem to be where a lot of places are going.
From what I understand, financial industries rely heavily on mainframes.
COBOL was designed to run batch programs where data was held in magnetic tape in fixed length records.

1. What the heck does PIC() do? I have seen it used for so much , but do not know what is is
PIC defines a field layout. It's like a format string for scanf.

2. Where are some good sites to learn COBOL that are not expecting me to use ancient and nonexistent compilers.
Dunno, an internet search finds some reasonable sites.

3. Is there any native way to get console input?
It wasn't designed for that, so I would expect you'd need some platform dependent extension--designed for batch, right?.

4. How do I import external code/libraries?
You don't. So if you can, it'll be using a platform dependent extension.

COBOL programs typically inter-operated thru a "link section"; global memory to me and you,

5. What is a good easy to setup/build compiler to get started with?
GNU compiler works, but I expect it'll be full of GNUisms (like everything else they do).
Last edited on
Topic archived. No new replies allowed.