× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hey All

I've got a small problem in ILE that I'm trying to understand. The question is this: can I open a file in a subprocedure, but have a different subprocedure write to the file?

So, I have something like this

-----------------------------------------------

ModuleA
h nomain
fQDDSSRC if e disk rename(QDDSSRC:DDSREC)
f usropn

dfunca pr
pfunca b export
dfunca pi

/Free
open QDDSSRC;
/End-Free

pfunca e

-----------------------------------------------

ModuleB

h nomain

fQDDSSRC if e disk rename(QDDSSRC:DDSREC)
f usropn

dfuncb pr

pfuncb b export
dfuncb pi

/Free
if not %open(QDDSSRC); // dummy open
open QDDSSRC;
endif;

read DDSREC;

/End-Free

pfuncb e
-----------------------------------------------

I build Modules A and B, and bind them into a service program. No problem.

-----------------------------------------------

Then I have one more Module, Module C, which looks like this:

dfunca pr
dfuncb pr

/Free
funca();
funcb();
*inlr = *on;
/End-Free

I compile Module C, and create a program with Module C and the service program. It runs, but no data from QDDSSRC shows up on the read. Looking at the Open File display, I see that there are two ODP's issued-- one for the OPEN in FuncA, and one for the open in FuncB.

So I thought if I just did an OVRDBF FILE(QDDSSRC) TOFILE(<mylibrary>/QDDSSRC) SHARE(*YES) OVRSCOPE(*JOB) I might have it. It still ran, but I get the same result-- no data read. The share numbers increment in the Open File display when the OPEN command runs in FuncA and FuncB, so I know the share is at least active.

I'm missing something fundamental here and I can't figure out what it is.

Any ideas?

Thanks!

-Doc




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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

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.