× 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.



Hi Mike,

> I have a logical file that is not uniquely keyed.  We are not able to
> change to a uniquely keyed file. We read the file and stop on a specific
> record.  The RRN is returned to the calling program. At another time,
> the program is called with the keys and the RRN again. We need to start
> at the record where we stopped before and continue reading.

As far as I know, the decision has to be made when the file is opened as
to whether the file is to be processed by key or by RRN.  You can't do
both.

What you could do is SETLL/READE on the file in a loop... and check for
the correct RRN in the INFDS.  Stop looping when you finally reach that
RRN.  But, I don't know if this would be efficient enough for your
purposes.

Also, keep in mind that any command like RGZPFM, CPYF, CHGPF, etc has a
good chance of changing the RRN of the records -- so I'd be very cautious
about using the RRN to remember where you left off.

> Does anyone have a recommendation on an efficient method to accomplish this
> task?

You haven't really told us what the task is...  Would it be possible to
keep the file open and positioned in the right place, so that when you
return to reading the file, you don't have to reset the file cursor?

Maybe it would make sense to submit a "helper job" that sits in the
background, just holding it's position on the file?  Then it could
communicate with your program via a data queue?

Or maybe a logical file isn't the best way to accomplish your goal?
Perhaps it would make more sense to use a queue of some kind?  Or a sorted
flat file that you can always access by RRN?

Hard to say what would work well without any knowledge of what the
application is trying to accomplish.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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.