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



Thanks,

I was thinking of an identical procedure for each file, so in my case as we're not yet on V6, a module for each. So I'd have as many access Then after the lecture of the masterfile I'd call a procedure that would act as a router to one of these procedures. The detail file record would be returned to the routing procedure. What do you think?

-----Message d'origine-----
De : rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] De la part de BMay@xxxxxxxxx
Envoyé : mardi 13 janvier 2009 17:40
À : rpg400-l@xxxxxxxxxxxx
Objet : Re: Problem with duplicated file names

Adam's suggestion is the only way I can think of to accomplish your desired functionality without opening and closing files to change libraries. If you want to pretty it up some, you could hide the select logic in a subprocedure so that it is out of the mainline. Something
like:

Fdetail IF E K DISK EXTFILE('LIB1/detail') F RENAME(detail:L1det) F PREFIX('L1') Fdetail IF E K DISK EXTFILE('LIB2/detail') F RENAME(detail:L2det) F PREFIX('L2')

Then, your read logic would look like
do %eof(masterfile)
Read masterfile
Myfield = GetDetailFileField(........)


StartSubprocedure GetDetailFileField

select
when library = 'LIB1'
chain L1Det
when library = 'LIB2'
chain L2Det
endsl

EndSubprocedure


Of course, this only works if the # of libraries involved is relatively constant. If # of libraries is completely variable (eg. library = item and user can create items at will), I have an idea that may work, but would require a little bit of thought before I post it.


Brian May
Project Lead
Management Information Systems
Garan, Incorporated
Starkville, Mississippi

Young i Professionals
http://www.youngiprofessionals.com

David FOXWELL wrote:

First read of masterfile :
ovrdbf to detailfile in lib1 or addlible lib1 in correct position Chain to detailfile reads file in lib1

Second read of masterfile
ovrdbf to detailfile in lib2 or addlible lib2 in correct position Chain to detailfile still reads file in lib1 because still open

[W]e are on V5R4.


I can think of a way of doing this, but it isn't particularly pretty. Nor is it tested, but I've done something similar before. You could define a different F-spec for each library's detail file, renaming the record formats and prefixing the fields as appropriate.

Fdetail IF E K DISK EXTFILE('LIB1/detail') F RENAME(detail:L1det) F PREFIX('L1') Fdetail IF E K DISK EXTFILE('LIB2/detail') F RENAME(detail:L2det) F PREFIX('L2')

Then, your read logic would look like
do %eof(masterfile)
Read masterfile
select
when library = 'LIB1'
chain L1Det
when library = 'LIB2'
chain L2Det
endsl
Myfield = detail file field

Hope this helps,
Adam
--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l.


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.