David FOXWELL wrote:
If FileDetailProcedure1 is called, it opens detailfile1 and returns leaving it open.
If FileDetailProcedure2 [in a different module with a different *LIBL] is then called,
can I now open detailfile2 or will a IF %OPEN(detailFile) return *ON even if detailfile1
is no longer in the library list?

I don't think that having identical F-specs in different modules bound in to the same program will be any different from your initial case of having one F-spec and changing the *LIBL between calls to that program.

The reason, is that ODPs (open data paths) are scoped to the activation group, not the module. The only way I can see your idea working is if each of these modules is in it's own *PGM or *SRVPGM so that they each run in a different activation group. That said, this is the part of ILE that confuses me the most, so please test for yourself if you don't believe me. :)

For what it's worth, I think that having 8 identical modules (even if it did work) is far uglier that my suggestion of using 8 F-specs with EXTFILE(). If it's the hardcoding that concerns you, EXTFILE() allows a variable as an argument, so you could allow any 8 (or however many F-specs you feel like putting in) libraries to be used instead of hardcoding the library names.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2026 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.