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



Yes, it is possible, dependent on OS release..

Define an F-spec and an external defined DS on the file in the sub-porcedure.

Then:  READE file FileDS

having the data in the external defined DS.


Op 9-10-2021 om 00:59 schreef James H. H. Lampert via RPG400-L:
We have a module containing a single subprocedure, (I'll call it "FOO" here) that is designed to be called recursively.

But part of what governs this is a file:

In any given call of FOO, we SETLL this controlling file (I'll call it "BAR"), and the key for the SETLL and READE "BAZ") and then loop through a READE of the file, making potentially many recursive calls of FOO for every record in BAR that matches BAZ.

But since the F-spec declaring BAR is at program level, each recursive call of FOO returns with BAR in an EOF state, short-circuiting the previous level's trip through BAR.

The obvious solution to this would be to declare and open BAR locally to each invocation of FOO, but can this be done in RPG? And if so, how?

--
JHHL


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.