COBOL Was: Re: Digital



On Tue, 31 Jul 2012 13:25:19 -0600, Bob Koehler wrote:

In article <1c33e186a94de7793fe65564135d43a7@xxxxxxxxx>, Nomen Nescio
<nobody@xxxxxxxxx> writes:
David Froble <davef@xxxxxxxxxxxxx> wrote:

I can show you tens of thousands of lines of Cobol code that don't
generate a single report.

I can show you ten million lines of COBOL code that does. But my point
was and is, COBOL is great for reporting and that is its primary
strength.

I, too have see large volumes of COBOL that didn't generate reports.
But I wouldn't cite it as good programming.

I had a lot of 4 times replicated fuctionality generated via cut and
paste code instead of calling reusable subroutines.

I came across that as well. One particular payroll program had code
replicated far more than 4 times, with names extensively modified so that
SEARCH didn't catch them all. I announced several times that I had fixed
one particular bug, only to be told I hadn't - go back and look again.

Another feature of that program was that it shuffled records up and down
some kind of array. Not one of us dared touch that bit of code.

Some bad COBOL programming habits have their heritage in compiler
limitations, others in common working practices of yore.

Prior to COBOL 85(?) the standard specifically banned the use of global
variables. Fortunately VAX-COBOL circa 1981/2 looked ahead and allowed
these.

In another example whoever was in charge of defining programming
standards had decreed that program Sections should be banned because they
had a performance penalty, and "Perform x thru y" was far more efficient.

That may have been true on whatever platform he had used before, but the
reverse was true with VAX-COBOL. I improved the maintainability of quite
a few programs by converting them to use Sections.

For those who don't know what COBOL sections are, they are chunks of
inline code with full access to the main program's data structures but
with defined (and enforced) entry and exit points.

Did I tell the story about the building society which took on school
leavers at the age of 16 or 17? The programmers sat at desks lined up
facing the front, just like a school class, with the chief programmer
sitting at a desk on a raised platform overlooking them. This was in the
days when you coded onto paper then passed it to the data prep department
who put it on punch cards. These folks probably didn't even get to see
their program running.

And when we compiled it, it overflowed the COBOL line counter on
DECSYSTEM 20s, leading to a nice latin message.

I came across this mentality too. Some obviously former COBOL programmer
had written a huge DIBOL program on RSTS, with not a subroutine in
sight. It simply wouldn't fit into the available memory we had on RT-11
so we had to chop it up and use overlays.

At some places they also paid bonuses based on the number of lines of
code written. There might be a more effective way to encourage copy and
paste but I can't think of one at the moment.

"You can write bad FORTRAN in any language." The same applies to COBOL.

--
Paul Sture
.



Relevant Pages

  • Re: Creating PDF in Cobol
    ... as result in pdf we got one rectangle large 4 inch, height 8 inch, ... - at beginning of report, or single page, put into pipe (with WRITE ... so there is no need to edit your old cobol apps ... Any other information how could I insert a graphic (JPEG) file within ...
    (comp.lang.cobol)
  • Re: COBOL Books - DONT bother to buy
    ... There is a point to OO, but many Cobol programs - especially batch ... With standard Cobol if you have a routine that works well but you need ... Take for example report programs. ... In any case the Payroll system works by serially reusing the Employee ...
    (comp.lang.cobol)
  • Re: Conversion from MF Cobol to.....
    ... Our printing product is called COBOL FormPrint and it does support ... report, form and document printing in COBOL. ... I've already contacted Liant and found out that RM/Cobol doesnot support ...
    (comp.lang.cobol)
  • Re: COBOL - no longer being taught - is a problem
    ... Yesterday Canada's well-respected auditor-general released a report ... including COBOL: ... For IBM-MAIN subscribe / signoff / archive access instructions, ... send email to listserv@xxxxxxxxxxx with the message: GET IBM-MAIN INFO ...
    (bit.listserv.ibm-main)
  • Re: Creating PDF in Cobol
    ... say adding a JPEG file into a PDF... ... There is a second way to build PDF from Cobol if your runtime ... Using lex i wrote a simple filter capable to capture text report ... at beginning of report, or single page, put into pipe (with WRITE ...
    (comp.lang.cobol)