When you say that that the databases are dumped onto QVD do you mean you have a QVW that does a 'LOAD' and then 'STORE' ? If so why not create the new field in that. Otherwise, what is the mechanism that dumps the data into QVDs - why not create the new field through the SQL statement or whatever?
That's it : I have a empty QVW (no interface) that reads a CSV file , generated from the mainframe, and stores it into a QVD.
As a matter of fact it works like this : a Cobol program, running on a Unisys mainframe, extracts table data and generates a CSV. It also generates automatically the script that will transform this into a QVD. When both are ready, it triggers QV.EXE outside of it (outside of the mainframe) to run upon them and generate the QVD file.
We did this all. It's working pretty nice.
So, when we build our final applications, we only read QVDs. Way faster. And it's very organized/automated.
Get a sample of a script like this from here, if you will : http://www.des.online.unimep.br/au/pub/FCMBI.QVS
So, what's the problem ? The problem is that many, many times a QVD has been used amongst several applications (QVWs). And, on all of them we're repeating a complex formula to calculate derivated fields.
So, I wanna generate this QVD with this calculated field already. I could do that on the mainframe. That is, I could do a pseudo-field only to carry on that new value, calculated. But I'd be wasting mainframe time to do that. I only would do this (and I already do it in fact) if the derivation formula can only be evaluated ON THE MAINFRAME.
On other situations, I can use low cost CPUs to calculate the fields.
After all, I want simply do something like this :
Load all of the fields from a QVD, add some more fields to it (columns) and then, store it again.
If you use the JOIN method, make sure to use the DISTINCT keyword and load enough key fields to create uniqueness -- otherwise you may generate additional rows. For a calculated field, it should be enough to list only the fields used in the calc.
join (Csv) load DISTINCT A, B, A * B as E resident Csv