Slashdot Mirror


COBOL Will Outlive Us All

jfruh writes "Here's an old computer science joke: What's the difference between hardware and software? If you use hardware long enough, it breaks. If you use software long enough, it works. The truth behind that is the reason that so much decades-old COBOL code is out there still driving crucial applications at banks and other huge companies. Many attempts to replace COBOL applications flopped in the 1980s and '90s, and we're stuck with them for the foreseeable future — but the Baby Boomers who wrote all that code are now retiring en masse."

31 of 318 comments (clear)

  1. Batch by mwvdlee · · Score: 5, Informative

    Well... that and the fact that COBOL is actually very good at what it was made to do; batch file processing.

    --
    Slashdot social media options: AIM, ICQ, Yahoo, Jabber and Mobile Text. Why no MySpace?
    1. Re:Batch by grh_angelone · · Score: 5, Funny

      I hate it. Stupidest language of all time. I'm trying to convert all these crap programs to nicely done RPG IV, but its a Don Quijote task. I hate the fact, that file access can only be done in 50 lines of code. String operations are total nonsense, ever tried to get a string rightaligned? RPG file access via chain is done in 5-6 lines including the definition of the file and rightalign via evalr().

    2. Re:Batch by jellomizer · · Score: 5, Insightful

      No, the language doesn't matter. It is the fact that the COBOL code is old. When it was popular it was common for organizations to write their own software. This custom written software was molded to fit the companies processes and workflow. Then you add decades of alterations and the software gets very complex, however it nearly covers the full operation.

      So now if you are going to replace it, right now it is popular to get these "enterprise" solutions that are so generic that it takes more work to configure it than it does to make new software or port the code in a new language.

      As well most organizations just don't know why they need to upgrade they just think they do, and after the upgrade they want a program to do exactly what the last one did.

      --
      If something is so important that you feel the need to post it on the internet... It probably isn't that important.
    3. Re:Batch by mwvdlee · · Score: 4, Informative

      Yes, I'm sure it's much easier to code in RPG. In Java/C++/PHP/C# you could probably do it in less than a dozen lines of code as well. But none of those come close to the performance of COBOL for these specific tasks.

      As far as right-aligning a string; it's supported in the data division: http://mainframewizard.com/content/cobol-just-right-clause. I'm sure if I had to program RPG without any training or a manual, I wouldn't produce very good code either.

      COBOL is bad at a lot of things and in a lot of ways, but it does have a few redeeming qualities. It just turns out those particular qualities are highly sought after in many large companies.

      --
      Slashdot social media options: AIM, ICQ, Yahoo, Jabber and Mobile Text. Why no MySpace?
    4. Re:Batch by grh_angelone · · Score: 5, Informative

      ok, this doesn't bring us any further, but do you really think, that moving something in a right justified variable is the solution?

      this doesn't only need another variable, but if your source value has trailing spaces you will need a ridiculously long INSPECT line and an index variable for a substring.
      since cobol is dumb, you will further need an INITIALIZE for both variables.

      cobol:
      01 var1 PIC X(50)
      01 var2 PIC X(50) justified right
      01 sub PIC 9(2)
      initialize var1 var2 sub
      move "test " to var1
      initialize var1 tallying sub for trailing space
      if sub = 0
      move var1 to var2
      else
      move var1(1:sub) to var2
      end-if

      rpg:
      d var1 s 50a
      d var2 s 50a
      c eval var1='test '
      c evalr var2=%trim(var1)

      seems way more convinient :)
      even tough RPG is ill-reputed as an old static programming language this looks somehow like any other high level language and anyone should understand what's going on here without trying to figure out what that strange INSPECT does

    5. Re:Batch by Anonymous Coward · · Score: 5, Informative

      No. COBOL was designed for taking simple decimal (BCD) representations of quantities and financial amounts, conducting basic arithmetic operations on those and transferring the result back to storage or line-printer-style reports.

      It is still the basis of a great many online, interactive applications as a result of the development of OLTP systems that were intended to provide "real time" transactions on top of old legacy batch procedures. CICS in particular is alive and well and nothing to do with batch processing - though its interactivity is largely achieved by having the display terminal emulate the fixed fields of punched cards and line printer columns - and although it has support for several languages, COBOL is where it found its natural home.

      There's nothing magical or mysterious about COBOL (apart, perhaps, from the MOVE CORRESPONDING statement) - it's a procedural programming language that works with simple representations of data. The idea that a modern generation of programmers can't understand it is ludicrous and anyone that suggests rewriting swathes of code simply to change the syntax of its representation doesn't understand the first principles of software engineering.

      COBOL is here to stay in both batch and interactive applications.

    6. Re:Batch by peragrin · · Score: 5, Insightful

      That because the cost of retraining people in new workflows is generally higher than the software package to begin with.

      If you gut and replace software you have to modify every employee's workflow to compensate. EVERY person has to do their job slightly differently, and no one has the answers as to how it all has to be worked out from the beginning for each part.

      That takes months in a small 20 person organization that is flexible and adaptable. It can take years of lost productivity for larger ones.

      I am doing it right now. We are gutting our old ERP system to use a much simplier but ultimately more useful ERP system. Everything from sales, accounting, purchasing, warehousing, inventory, delivery drivers, all have to change how they process their paperwork. We basically had the office staff doing 2 days of nothing as we sorted out bugs with the initial data transfer. Now that is done we begin the task of sorting out workflows, new SOPs, etc.

      --
      i thought once I was found, but it was only a dream.
    7. Re:Batch by johnnyb · · Score: 5, Funny

      The real problem with COBOL is that, as Larry Wall has pointed out, you can't write poetry with it. There just isn't any good poetry that starts out with IDENTIFICATION SECTION.

      The one thing I do miss about COBOL is easy access to fixed-point numeric processing. This seems like a no-brainer, but it is still missing from nearly every language.

    8. Re:Batch by VortexCortex · · Score: 5, Funny

      There once was an IDENTIFICATION SECTION
      Preceding a formula that defied all reflection.
      Using all the chem-lab's powers,
      it ran longer than four hours,
      To make pills that promoted erection!

    9. Re:Batch by telchine · · Score: 4, Funny

      It just turns out those particular qualities are highly sought after in many large companies.

      It keeps its head down, doesn't rock the boat and never asks for a pay rise?

    10. Re:Batch by mabhatter654 · · Score: 5, Funny

      RPG vs COBOL!!!

      Fight! Fight!
      Canes and walkers allowed... No punching the kolostamy bag.

    11. Re:Batch by Anonymous Coward · · Score: 4, Funny

      There once was an IDENTIFICATION SECTION

      Preceding a formula that defied all reflection.

      Using all the chem-lab's powers,

      it ran longer than four hours,

      To make pills that promoted erection!

      ...Burma Shave

    12. Re:Batch by Anonymous Coward · · Score: 4, Funny

      IDENTIFICATION DIVISON.
      PROGRAM ID. A COBOL FABLE.
      SECURITY. INSECURE.
      PROGRAMMER-ID. ARTHUR SHAPIRO.
      REMARKS. SLIGHTLY MORE MANGLED VERSION OF ONE IN JAN., 1968
      DATAMATION.
      DATE WRITTEN. ONCE UPON A TIME.

      ENVIRONMENT DIVISON.
      CONFIGURATION SECTION.
      OBJECT COMPUTER. ANY MUSIC BOX, MEMORY SIZE 8X64 BYTES,
      19 TAPE DRIVES, 11 DISK DRIVES, 1 GOLDILOCKS, 3 BEARS.
      INPUT-OUTPUT SECTION.
      FILE-CONTROL.
      SELECT TAPE DRIVES, ASSIGN THEM TO CREDITOR.
      SELECT DISK DRIVES.
      SELECT GOLDILOCKS, SELECT BEARS, ASSIGN TO ONE COTTAGE.
      I-O CONTROL.
      APPLY RED TAPE TO TAPE DRIVES, APPLY BRAHMS RECORD TO DISK DRIVE,
      APPLY GOLDI, BEARS TO COTTAGE.
      DATA DIVISON.
      FD GOLDI.
      LABEL RECORDS ARE STANDARD
      VALUE OF IDENTIFACTION IS "GOLDILOCKS"
      DATA RECORD IS GOLDILOCKS.
      01 GOLDILOCKS.
      02 HGT SIZE IS 62 INS.
      02 WGT SIZE IS 110 LBS.
      02 VITAL-STATS.
      03 B 38.
      03 W 24.
      03 H 36.
      02 RATING 100%.
      FD THREE-BEARS.
      LABEL RECORDS ARE STANDARD
      VALUE OF IDENTIFICATION IS "BEARS"
      DATA RECORDS ARE DADDY-BEAR, MUMMY-BEAR, BABY-BEAR.
      01 DADDY-BEAR.
      02 HGT 70 INS.
      02 WGT 750 LBS.
      02 COLOR-OF-EYES BLOODSHOT.
      02 DISPOSITION UNBEARABLE.
      01 MUMMY-BEAR.
      02 HGT 65 INS.
      02 WGT 700 LBS.
      02 COLOR-OF-EYES BLUE.
      02 DISPOSITION BEARABLE.
      01 BABY-BEAR.
      02 HGT 40 INS.
      02 DISPOSITION INFANTILE.
      WORKING-STORAGE SECTION.
      01 COTTAGE PICTURE IS COZY.
      02 KITCHEN.
      03 TABLE SIZE IS LARGE, VALUE IS 1.
      03 CHAIRS SIZE IS MEDIUM, VALUE IS 3.
      02 PORRIDGE.
      03 KING-SIZE OCCURS 1 TIME.
      03 QUEEN-SIZE OCCURS 1 TIME.
      03 PRINCE-SIZE OCCURS 1 TIME.
      02 DOOR SIZE IS USUAL, VALUE IS OPEN.
      02 BEDROOM.
      03 BED.
      04 LARGE OCCURS 1 TIME.
      04 MEDIUM OCCURS 1 TIME.

    13. Re:Batch by Dimitrii · · Score: 4, Interesting

      even tough RPG is ill-reputed as an old static programming language this looks somehow like any other high level language and anyone should understand what's going on here without trying to figure out what that strange INSPECT does

      Back in the late 80's early 90's, I was a co-op for IBM. I wrote an RPG program to rearrange some data file. Because of scope, the program had to be reviewed by a senior programmer.
      "This is just a start. Where is the rest of it. Do you need help?"
      "No. It is complete. Sample input and output files right next to it. I used the cycle"
      "The cycle still works?!"

      I had learned RPG II in HS. The cycle is all that was needed. He showed that program to every programmer that walked into his office.

      The deal it that it all keeps working.

    14. Re:Batch by bws111 · · Score: 5, Informative

      Um, no. I don't know where you got that crap, but it is entirely false. IBM itself currently sells COBOL, FORTRAN, C/C++, PL/1, and REXX compilers for z/OS. In addition, you can use gcc, etc.

      And your line about IBM mainframes not having protected memory is complete bullshit. They have had protected memory since 1964. It is not an option.

      And NO user space programs affect system integrity, no matter how they are written or what language they are written in. That is one of the major selling points of z/OS.

    15. Re:Batch by frank_adrian314159 · · Score: 5, Insightful

      ... the following languages all support an accurate decimal data type in the standard libraries: Python, Ruby, Java, and Objective-C.

      Which is not the same as supporting it in the language itself, either from a convenience nor a performance point of view.

      --
      That is all.
    16. Re:Batch by Sique · · Score: 5, Informative

      When COBOL was being used for new development, I don't think the P1 was even out, we're on Xeons now.

      When COBOL was being used for new development, the microprocessor wasn't even invented yet, and Intel founder Robert Noyce was working at Fairchild Semiconductor and had his first integreted circuit ready.

      --
      .sig: Sique *sigh*
  2. If a technology is outdated, outsource it. by ixarux · · Score: 5, Interesting

    Yup. I was hired into one of those mainframe companies that worked with COBOL and JCL. The work was the most menial of works I had ever done(after they trained me for 6 months in it).
    The financial sector, the lumbering dinosaur that accepts change only when they have no other option, and the ones maintaining decades-old mainframes really have no incentive to change technologies at the moment. It's easier to just outsource the maintenance and servicing of the mainframes. There are enough of coders (like in the company I joined) in developing countries across the world who would gladly take it up.
    From my experience, there is little development happening any more. I think the day when they run out of people who want to this crappy menial job (which is never) is the day COBOL will go extinct.

    1. Re:If a technology is outdated, outsource it. by jandersen · · Score: 5, Interesting

      So, you didn't like to work on a mainframe, then?

      But don't slag off the mainframe just because it is 'old' technology - the PC architecture isn't all that young either, and the mainframe, believe it or not, is in fact very VERY much on the technological forefront, hardware wise. Mainframes had fiber attached disks before most modern developers had heard of networking.

      Big to huge institutions don't use mainframes because they are too backwards thinking, but because of reliability. In an industry where downtime costs millions to tens of millions per minute, that counts a lot. On a mainfram you can hot-swap just about everything - not just disks, but everything. And if you wish, you can run Linux on it as well; but it is amazing how often the choice is MVS and COBOL; that is because they are just what you need - not multitools like UNIX and C, just a plain old knife meant for cutting only.

    2. Re:If a technology is outdated, outsource it. by mapsjanhere · · Score: 4, Funny

      You're missing the main point - programmer productivity. You know how hard it is to surf porn on a VT100?

      --
      I'm aging rapidly, I bought a new game and had no idea if my machine was good for it.
  3. Lords of COBOL by ae1294 · · Score: 5, Funny

    All of this has happened before and will happen again...

  4. If it aint broke... by detain · · Score: 4, Interesting

    why bother paying tons of money developing new software, going through the painful growth and ironing out all the bugs of the new software, educating people on the new software, importing your current clients into new software, getting modern hardware to run the new software, installing modern networking equpment for the new hardware to run the new software, etc.. theres just no real reason to upgrade the software. There won't be many new exploits for COBOL based software as well, since its not used by the average person.

    --
    http://interserver.net/
    1. Re:If it aint broke... by Anonymous Coward · · Score: 4, Insightful

      My guess is that a rewrite will not give you something modular and well designed, it will more likely result in a reformatting of all the data into millions of incomprehensible XML files.

    2. Re:If it aint broke... by DarkOx · · Score: 4, Insightful

      The character set limitations are really platform issues not issues with COBOL or even in most cases the programs written it in. Honestly I have never understood all the COBOL hate. Sure it fails to deliver on its promises of letting business folks write code without any domain specific training in software develop. Just like every other language that has approached that challenge mostly BASIC or Object BASIC dialects.

      That said I'd be actually pretty surprised if a good C/C++/Java/Ruby/Python/PHP/whatever guy could put together a program to do something like print a fifty million decent looking telephone bill statements with accurate summary lines for transaction-data as quickly as a COBOL programer of similar skill and experience can. There really are some problems COBOL solves well. Bulk record processing and account reconciliation is one of those things because that was pretty much THE commercial and military logistics application for computers in the LATE 40's when COBOL was born. COBOL as you might expect is quite fit for that application.

      Its when people start trying to do interactive applications in COBOL be it CICS or web or whatever it gets silly and forced. It brings to mind various analogies about square pegs for round holes, and threaded fasteners to be deployed by hammer. Its sorta like how people tried to CGI applications in C for a long time in the webs early days. Sure it worked and if C was all you knew I suppose you could get the job done. C is good at many things, large amounts of string manipulation is not one of them; but its something you need for a dynamic website. Does that make C a bad tool, no, it just means its the wrong application for it.

      --
      Repeal the 17th Amendment TODAY! Also Please Read http://www.gnu.org/philosophy/right-to-read.html
  5. Every 3 to 5 years. by sgrover · · Score: 5, Insightful

    Every 3 to 5 years this topic comes up. It's almost like some new batch of CompSci graduates start to evaluate the state of the industry, and share their "discoveries" with the world. Except it is the same old discoveries couched in modern terms.

    1. Re:Every 3 to 5 years. by mvdwege · · Score: 5, Insightful

      That's because IT is suffused with a teenage culture that equates 'old' with 'useless'.

      Being able to spew the buzzwords related to the newest fad seems to be a requirement for a dev job these days.

      It doesn't help that the industry as a whole (especially in the US) seems to prey on young naive workers and likes to keep them that way in order to extract the maximum profit out of them.

      --
      "I know I will be modded down for this": where's the option '-1, Asking for it'?
  6. COBOL is a work of genius by sirwired · · Score: 5, Insightful

    Viewed through the eyes of a modern programmer, COBOL is indeed a joke. A horrible one. It violates nearly every single principle of good language design in what appears to be a misguided attempt to make programming "friendly." A CS undergrad would get a poor grade turning in something like COBOL as a Programming Languages 101 project.

    But for a language first specified in 1959 (when computing didn't even have the Integrated Circuit yet), it's a work of staggering genius; they didn't HAVE all those rules of good language design to fall back on! At the time, FORTRAN had been out for all of two years and LISP for one; hardly enough time to have much experience with knowing what not to do, and neither of those languages targeted the same problem domain.

    COBOL made modern computing accessible and useful to businesses. It's programs have maintained decent backwards compatibility for about half a century. And for all it's foibles, all those hundreds of millions of lines of COBOL actually work. They may be a disgusting kludge, a result of decades of compromises, but these gigantic black boxes of spaghetti Work. And there's no reason to think they'll stop doing so any time soon. Nor any reason to believe that replacing them would be in any way cost-effective.

  7. Speaking of COBOL outliving us all... by fuzzyfuzzyfungus · · Score: 4, Interesting

    Does anybody know what language(s) are used for the "Dead Hand" second-strike control system that the Russians were working on during the Cold War? Personally, I'd nominate them as the programming languages that will outlive us all...

  8. Hire veteran COBOLers, retirements won't matter. by emes · · Score: 5, Insightful

    It is a bromide perpetrated by ITAA and business groups that we can't find enough programmers to replace the ones who are retiring.

    The simple truth is that no one wants to PAY what people are worth, and there is rampant age discrimination:

    http://www.itbusinessedge.com/cm/blogs/tennant/yes-age-discrimination-is-worse-in-it-than-in-other-fields/?cs=38549

    Be willing to hire, retrain, or do whatever it takes to employ people over 35 and this so-called problem will be
    shown to be the chimera that it really is.

  9. Re:So Simple! by paiute · · Score: 4, Funny

    So get that manual out, and have a try!

    These seem to me like famous last words, almost as dangerous as the classic "Hold my beer and watch this!"

    --
    If Slashdot were chemistry it would look like this:Cadaverine
  10. OpenCOBOL.org by emil · · Score: 4, Informative

    If you have any contact with COBOL in your profession, check out OpenCOBOL.org.

    With a free COBOL compiler, you have an option of moving this ancient code onto a modern platform with fast CPUs. If you find it lacking, start coding!

    I've tested it for Linux and Cygwin, and it works.