On Wed, Aug 12, 2015 at 4:38 PM, Buck Calabro <kc2hiz@xxxxxxxxx> wrote:
We have similar things going on here. We'd write a query because it was
faster than writing a program. Then we had to do something special to
format it. Then we had to do another special thing to send it. Then
another special thing to avoid sending it if it was empty.
It turned into a lot of work in order to save ourselves the work of
writing a program. I guess in the end it was OK because the work was
spread out over time...
Today, I'd argue for a proper program that does the extract, formatting,
and if there's something to be sent, do the emailing.
I prefer the "proper program" approach too. Especially since they are
not much more heavyweight than the corresponding "noncoding" tools.
It doesn't take a whole lot of learning SQL before SQL becomes at
least as good as WRKQRY for querying. (Trying to express ((A or B) and
(C or D)) in WRKQRY gets old fast.) Then if you wrap that SQL up in a
full procedural language like RPG (or better yet, Python ;), you've
got room to at least bolt on your later fixes in one language rather
than a panoply of various tools.