|
Dennis Lovelady wrote:David Foxwell wrote:
You said (paraphrasing since I don't have the original here) that CLP (which I hope is actually CLLE) does: OPNQRYF followed by CALL TESTPGM... and TESTPGM uses the same
filename.
Here's what I wrote originally:
CLP OPNQRYF (myfile) with kfld changed from 5 to 3 kflds.
call testpgm
testpgm calls mypgm which also uses myfile and the 5 original
kflds.
Obviously, the opnqryf must be changed, but how should we have
done it?
<<<<<<<
CLP, (not CLLE!) does the OPNQRYF and calls testpgm(the program
my coworker was testing) as it has done for several years. A
subprocedure called by testpgm now calls mypgm.
You failed to answer questions about OVRSCOPE and OVRDBF but
I'll assume that, one way or another, the OVRSCOPE(*JOB) was
used, and that SHARE(*YES) has been specified.
In mypgm, the file used in the opnqryf is declared. Thus, as I
have learned from the experts during this thread, mypgm will
not open a new data path, but share that of the opnqryf.
We have addressed the fact that ODP will not be implicitly
shared.
However, a subprocedure in mypgm issues a chain to myfile,
using 5 keyfields. The opnqryf specified 3 kflds and the
program crashes with the message that I'm using too many fields
to access the file.
One solution to this would be to use a different filename (and different OPENID) for the OPNQRYF. That would involve a change to
MYPGM and to the OPNQRYF command. Another would be to use
consistent number of keys (5). If the three keys you are using in
MYPGM are not the same as the first three keys used by TESTPGM,
you are asking for trouble unless you use different names. If
they ARE the same, however, then a change to 5 keys in OPNQRYF sounds like a right solution.
Having said that, you know (and we don't) how these files must be
accessed. We can make recommendations until the stars all fall,
and still be dead wrong since the only thing we know about your
goal is that you want to understand override scopes.
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.