On 10/23/2013 4:25 PM, Matt Olson wrote:
It seems if you don't use embedded SQL to access data, chaining becomes a nightmare in RPG in very well normalized databases or you get logical file "forests" where logical files propagate like crazy.
It seems the same whether I use RLA or SQL.
CHAIN, CHAIN, CHAIN <==> SELECT nnn FROM x JOIN y
CHAIN <==> SELECT nnn FROM VIEW
Maybe I'm missing something?
Most databases I have seen in RPG environments are not very normalized, presumably because it's easier to chain to them when all the data is just there in one file rather than multiple nested files.
I think the observation is fair enough, but I have not met any RPG
programmers who think it's easier to CHAIN to 3 or 4 PFs than it is to
CHAIN to a single LF.
If someone were to ask me why the state of so many RPG-accessed
databases is so parlous, I'd say it's because management is pleased
enough with the batch processes we inherited from the 1970s that they
are choosing to spend their money elsewhere. We technical types need to
constantly remind managers about the need to reduce technical debt.
I myself work with a system that has some very old processes - I'm sure
I can directly trace their lineage back to a card reader - as well as a
brand new relational database that we're working on in parallel with the
current database. We aren't swapping out the entire application in one
go; we're doing it piecemeal. It's a bit ragged at times, but we're
And without either a forest of logicals or a nightmare of CHAINs.