I am looking for a way to simplify building logical files defined by sql create view statements.
Currently we use runsqlstm and specify a source file and member. This seems to work fine except when I do something like re-create a test environment. In order to insure that all of the logicals point to the correct physical, I had to go through and edit the sql source for every file in order to change libraries that were called out in the sql statement. I could let this fall through to the library list, but I prefer to call the libraries out explicitly.
Two approaches have come to mind in order to achieve this goal. One idea was to use query management queries. This allows the use of variables, but it appears that a query management object has to be recompiled after each change before the actual query can be run. I was hoping for something a little simpler.
Second, I thought of using the db2 command from qshell and setting environment variables in order to substitute the appropriate libraries. I favor this approach because it puts the source into text files in the IFS which are easier to integrate into other tools. I got stuck on how best to perform the library substitutions into a predifined sql statement in a standard way that would allow the entire process to be scripted.
How have others solved this problem?