COBOL optimization has always been problematic for two reasons.

The less important of them is that, until now at least, some
syntactically interesting features of the  language have been
implemented very poorly.  Some COBOL EVALUATEs are, for example,
functionally very like a C switch or a PL/I select(<single
character>).  They have not, however, been inplemented in COBOL using
a branch table, as such constructs are in C and PL/I, but as if nested
IFs had been written.

More important, COBOL arrays were for long too small to meet the
requirements of many applications.  For this reason, the practice of
extending these arrays informally by (mis)appropriating the storage
immediately following too-small ones for phantom elements addressed
using formally illicit subscripts has been common.

This is only one of a number of ways in which COBOL has been abused,
written around by people who copied coding idioms without
understanding them very well.  Optimizers, understandably, did not
recognize these dubious constructs; and the consequences were
unfortunate.  For these reasons many mainframe COBOL shops have
interdicted the highest levels of optimization that IBM has made
available.

I think Timothy Sipples is right about the phrase "well structured".
Well structured COBOL programs do exist, but they are rare and usually
short-lived:  maintenance tends to convert them into rats' nests---the
COBOL idiom is 'spaghetti code'---over time.  I suspect that the
intent of this IBM language is to suggest that even COBOL programs
judged to be well written and efficient will benefit from being
optimized.

I also suspect that attempts to optimize old code that misuses COBOL
language facilities systematically will continue to be problematic.
This IBM initiative is nevertheless a very welcome one.   It may
prompt some mainframe COBOL shops to address economically important
performance issues that they have been shirking.

John Gilmore, Ashland, MA 01721 - USA

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to