-------------------<snip>-------------
You've got that right! I see many code examples in many languages on the
Web. I tend to try to correct messages where there is "suboptimal" code.
Why? Because cut and paste programmers will continue to use that
horrible code until the end of time. Of course, I cannot fix all of it
because I really don't have the time or the talent. I would love to have
someone with a maintenance mindset do a "check" of some of our COBOL
code (no time or money for that). I rewrote a single COBOL program
myself. The run time went from about 12 hours to less than one hour. And
it was a change to only one paragraph. And not likely a truly optimal
change at that.
---------------------<unsnip>------------------
We did something similar. Programmer coded IDMS "PREPARE" and "FINISH"
comands inside a loop that was being executed 200,000-350,000 timer per
run! Just moving the "PREPARE" and "FINISH" commands outside the loop
cut the run time from 4+ hours to less than 20 minutes. EXCP counts
attributable to this program were cut from over 3,000,000 to less than
400,000, dependant on actual record counts.
If there's no alternative, you do what you must, but a sudden outbreak
of common sense should be greeted with cheers and confetti; it so seldom
happens. :-)
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html