Whatever happened to COBOL?

Way back in the mid-80s, I took computer programming classes in hopes of becoming a programmer. The only language I enjoyed was COBOL (as opposed to RPG (which I despised) and BASIC). Is it still being used?

if it’s any indicator I hear good natured insults that go along the lines of “oh yea? well you still program in colbolt!”

Yep, it’s still used (I am, among other things, a COBOL programmer).

Its ascendancy was obscured somewhat during the Internet bubble, when anyone who had written five pages of HTML and a Java applet that almost worked thought that that justified a six-figure salary. Now that the webbie wannabes are saying, “Do you want fries with that?”, however, the enormous amount of “legacy” COBOL code becomes a bit more apparent.

Not just “legacy,” Akatsukami. PeopleSoft (Benefits Administration, at least) is built over a COBOL core. I know because the denizen of the cube next to me is charged with supporting it, and every now&then I can hear his reaction when they deliver a module that won’t compile, much less run properly.

I teach C++, and a good portion of my students are MIS majors. At my school, they are also required to take COBOL as one of their required programming courses.

I never had to use COBOL in my Computer Science classes (which, if the college doesn’t find yet another hoop for me to jump through, I should be done with). Mostly used C, C++, or Java. (One class used only LISP, and I will never forgive that teacher for choosing that language.)

I wouldn’t mind learning COBOL though. I admit I know nothing about it. Is there another language that it’s similar to? Pascal? I’m guessing it’s not a C-type language. Anyone know of any tutorials online, or good books on the subject? Akatsukami, any words of wisdom for a rookie programmer like me?

Isn’t COBOL closely related to MVS, or am I smoking the rock again?

When I was working for EDS, I had to take a COBOL class, even though, AFAIK, we didn’t use it.

I had to take a Control-M class too, even though they were already planning on phasing it out.

Wonders of inovation, EDS.

COBOL is THE IBM mainframe language - I have used it for 20+ years, and, while the rudiments of any language are the same (define storage, file i/o, branching, conditionals, etc.) perform the same functions the same, COBOL is much more rigidly structured (and self-documenting).

BASIC/FORTRAN/PASCAL: B = A

COBOL: MOVE A TO B.

C: name longchar

COBOL: 05 name.
10 last-name pic x(20).
10 first-name pic x(12).

In COBOL, EVERY field must be defined before it can be referenced - if you code “COMPUTE GROSS-PAY = HOURLY-RATE * HOURS-WORKED”, you will have to have defined all three terms - it will not generate a “GROSS-PAY” field for you.

But yes, when you see the sign in your bank reading “Interest Compounded Daily” - it really is - a big-mother mainframe complex is munching every account in the bank, applying debits, charges, credits, then calculating interest every frigging day. In COBOL.

In the seventies, or about then, I was told it stands for **C[/]ode **O[/]ur **B[/]oss **O[/]bviously **L[/]ikes. So, the larger the organization, the more likely the code is in Cobol. Or at least was, and a lot of those bosses are still the boss.

Tris

And didn’t I cover myself with coding laurels?

Duh.

Code Our Boss Obviously Likes

The company I work for still uses COBOL. Our department uses COBOL programs that the programming department writes, but we also use Generic Reformat and DataStage. For things Generic Reformat (“GRF”) won’t handle, there are two of us who program in Easytrieve Plus, which is similar to COBOL.

Now if only I could find a company in Washington (state) that wants to hire an Easytrieve programmer…

COBOL was a report-generation language invented in the 1960s by people who thought making code verbose meant making it easy to read. It is still used, as has been shown in this thread, but most programming is now done in C, which is more efficient and more portable, or an interpreted language like Perl, which is more flexible and better tuned to the modern world.

I still insist that the Mainframes, at least the ones used by EDS, use MVS rather than COBOL. Although they are really really similar.

I think this stems from the EDS/IBM rivalry of the 60’s and 70’s.

Personally, I could care less.

And happyheathen- I thought JCL was the actual language, or does JCL allow us to extrapolate data without having to code it into MVS (ie: MVS code that runs a chunck of JCL to get data, then resumes running the MVS with the new data added concatenated… hehe into it)?

Tristan,

“MVS” is an operating system for IBM and IBM clone (like Hitachi and Amdahl) mainframes. Think of MVS as DOS or Windows for an IBM PC.

“Cobol” is a programming language…a structure under which programs are written that run on the mainframes. Think of BASIC for an IBM PC.

“JCL” (Job Control Language) is not a programming language per se…JCL is control statements that are used in the running of “batch jobs” on IBM mainframes. You don’t write a program in JCL. Your JCL spawns a “job” on the mainframe. The job invokes programs and specifies data to be used, outputs, etc.

Hope this helps.

I thought JCL was IBM’s notoriously ugly Job Control Language. As in, a language to implement a form of primitive multitasking.

Oh, happyheathen, I think your C snippet is a little off. If you are typing the variable name' to be a long char’ (assuming your compiler recongizes any such beast, as opposed to a long int' or a long float’), you’d do this:


long char name;

Typedefs can confuse the issue a bit, but the name of the type precedes the name of the variable being typed.

But the very idea of a `long’ character type makes no sense. C implements strings of characters as arrays of individual character values, null-terminated. So you’d probably do something like this:


char name[] = "Ronald Regan";

The square brackets makes `name’ an array, and the compiler automatically computes the length of the string constant.

Alternatively, you could do this:


char name[LONG_NAME_LENGTH];

where LONG_NAME_LENGTH was `#define’d with a preprocessor directive and is the longest name you want your program to have to deal with.

I’ve probably missed a few things here, but that’s what’s on the top of my head at the moment.

I learned it in school in '86. use it on and off since then. Nowadays I’m writing/maintaining code that uses it and embedded SQL. The SQL goes after/insert/updates oracle tables.

It has it’s uses, as far as I can see. I use it for complicated printing applications and programs that do editing of incoming data. I like it, it’s easy to understand. People I work with have been going to Java and XML training for a couple years now and they still haven’t got anything to run with it. I’m not looking forward to that.

Piffle. COBOL was created in the 1950s. It is not a report generator (nor was it then), but a full function language.* (In fact, Easytrieve, Eastrieve Plus, Dyl-280, and Focus–along with IBM’s Report generator extension) were all created because COBOL was not a good report generator.)
Its “verbosity” does not make it easy to read–its general English format makes it easy to read. I have taken COBOL listings to meetings with users and they have been able (with minor assistance) to understand what the program does, themselves, thus reducing the amount of user<=>programmer<=>program translation necessary to get changes ironed out.

I am not arguing that COBOL is wonderful or better than any other product. (I would hope that in over 35 years, we’ve made some improvements in programming.) However, your comments were simply inaccurate.

  • I recently assisted in a project to use COBOL and CICS to drive a web application, meaning that we did not have to port all the massive mainframe databases to multiple servers, continued to reap the benefits of the COBOL parsing and reformatting functions, and drove the web queries in addition to pumping out whatever reports were requested.

In the days long, long ago when most computers were mainframes, then Cobol was big. Then came minicomputers, then PCs and the World Changed (long before the Internet bubble). While there were (are) Cobol compilers for the latter, it never took hold. E.g., Microsoft long ago abandoned their Cobol compiler.

Secondly, starting in the 80s, large numbers of CS students who had used modern languages and OSes starting filling up IT departments. They hated Cobol, and once they became managers, they got rid of it. It’s getting harder and harder to maintain legacy backwards system compat. to run those old programs.

But as recently at ~'96 I heard IT idiots claim that “60% of all programs are written in Cobol.” or some such nonsense. Have these people ever been in a CompUSA?

If you check job listings, it is a rare, rare day to see “Cobol programmer wanted.” A recent /.ed article didn’t even list it in its stats for jobs by language.

It pretty much is a dinosaur waiting for the comet.

Have you ever seen a real computer?

PCs with GUIs are excellent things for relatively unsophiscated users who require interactivity to do their jobs. But you won’t process thirty million transaction a month on one.

Sorry about the “C” code - i’m a COBOL dino :slight_smile:

COBOL = Common Business-Oriented Language. As opposed to FORmula TRANslation, which was scientific-oriented.

Job Control Language - tells MVS (a descendant of VS1, which was a successor to an operating system known as DOS) what to execute.

Let’s say I want to run a simple payroll (always used payroll as an example).

I break the processing down into 3 programs (which I write in COBOL):

PAYROLL1 -This edits timecards, and matches them to the employee file. It then passes the valid timecards to program PAYROLL2, which calculates the gross, witholdings, and net. It then passes the calculations to PAYROLL3, which actually cuts the checks and ledgers.

The JCL would look something like this:




//PAYROLL JOB (jobaccountinginfo),CLASS=J,MSGCLASS=A
//*
//STEP01 EXEX PGM=PAYROLL1
//*
//CARDSIN DD DSN=PR.WEEKLY.TIMECARDS(+0),DISP=SHR
//*
//CARDSOUT DD DSN=PR.WEEKLY.EDITEDCARDS(+1),
//                  DISP=(NEW,CATLG,DELETE)
//                  UNIT=SYSDA,
//                  SPACE=(CYL,(10,5),RLSE),
//                  DCB=(RECFM=FB,LRECL=135,BLKSIZE=13500,
//                  DSCB=SYS1.GDGBASE)
//*
//STEP02 EXEC PGM=PAYROLL2


etc. and yes, in the world of mainframes, everything is in caps, and monochrome Horrors!