|
> I displayed the override and there is an existing override to LIBB for > FILEA. When I chain to FILEA it still seems to be looking at the file as > if it is not overridden because records that I know are not in > LIBB/FILEA are being being found. Those records are in *LIBL/FILEA, but > not in LIBB/FILEA. I know that for sure. Any ideas? The problem with the override is that it determines which file to pull records from, which library, etc, when the file is OPENed, not when the file is read from. Unless you have the USROPN keyword on your f-spec, the file is opened "automagically" when the program starts. Since your override is being issued after the program starts, it has no affect. The solution is to: 1) Add the USROPN keyword to your F-spec. 2) Do the override. 3) Right after the override, execute the OPEN op-code on your file. 4) Use the file. 5) When you are done with the file, execute the CLOSE op-code. 6) Right after the CLOSE issue a DLTOVR command. Of course, the other alternative is to issue an override before the program starts. For example, from a CL program that first does the override and then calls the RPG program. I like doing my overrides inside my RPG, personally. If often eliminates the need to maintain an additional CL source member, eliminates activation group errors when doing the overrides, and allows me to base the open on variables that are calculated in the RPG program. But, that's just my opinion.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.