On Dec 24, 2015, at 4:06 PM, Richard Pinion wrote:
Don't use zoned decimal for subscripts or counters, rather use
indexes for
subscripts and binary for counter type variables. And when using
conditional
branching, try to code so as to make the branch the exception
rather than the
rule. For large table lookups, use a binary search as opposed to a
sequential
search.
These simple coding techniques can also reduce CPU time.
Very true. EREP has one report That does this and it took a LOT of
CPU seconds to run it.
At the time IBM distributed microfiche for the module in question
(sorry do NOT remember the name)
I went through the module and found that instead of indexing into an
array the IBM did a sequential lookup.
It was unfortunate that the module was written in PLS so I couldn't
fix it easily. I opened a PMR with IBM about performance on the
module and when I explained what the coder did and how easily it
could be fixed. I got a laugh out of level 2 and was told to live
with it.
I decided to write a quicky report that erep put out and it ran in
less than 5 seconds CPU time. I replaced the IBM procedure with one I
wrote and the CE was happy and I never bothered to let him know that
it wasn't an IBM report.
He was happy and the whole program took maybe 20 minutes to write and
30 minutes debugging and instant CE happiness .
Ed
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN