On 2011-10-24 19:24, Chuck Guzis wrote:
On 24 Oct 2011 at 16:25, Vintage Coder wrote:
Decimal math (hardware supported) is used heavily
in financial
processing with IBM COBOL. No loss of precision because the type is
base 10. BCD is very similar to what IBM calls "packed decimal".
Only COMP-3 was packed decimal; COMP-1 and COMP-2 are single- and
double-precision real/floating/binary exponential. All others are
usually internally integers (scaled where a point is specified)
unless DISPLAY, which is kept as decimal character.
A long time ago, I was instructed that the "native" S/370 (integer) data
format was S9(4) COMP and that it should be used whenever possible for
fastest performance (counters, indices, etc.). I've now worked on
non-IBM iron long enough that when I go back to the 360 family, I'll
have to resort to the manuals to see if that still holds true and what
formats are preferred these days on the fancy Z hardware.
Mind you, these things are no longer considered important, nowadays; "we
got plenty of storage and processing power to spare", so just use
whatever comes to mind and let the conversions be done by the compiler.
It's not until the weekend batches start overlapping the Monday morning
online processing that people show up at my desk asking how to squeeze
their jobs back into the batch window. Even then, a re-order of some
WHERE clauses in SQL statements usually shaves about 50% off the
processing time.
Some of these guys seem genuinely surprised that the order in which
statements are placed can actually have influence on performance.
Imagine that! And it's not just the programmers; competent DBA's that
know more than to up the storage quotum when a table runs out of space
are few and far between, too.
Programming with performance in mind is a vanishing art and an unpopular
skill (in practice, that is; on paper, everybody pays lip service to it)
these days. The solution is almost invariably to throw new hardware at
the problem. Can't blame them, really. I mean, if I were in charge and a
programmer told me, "give me three years and I'll have it running twice
as fast on the current hardware," I'm pretty sure my reaction wouldn't
be to give the go-ahead on that one.
.tsooJ