|
Depending on the complexity of the files, I would either follow Kyle's suggestion of using %EOF without the filename, or use embedded SQL and the PREPARE statement to open and read via a single cursor. There's an example at http://code.midrange.com/index.php?id=8f10ae73c7 which should help, note it hasn't been tested... All the best Jonathan www.astradyne-uk.com -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Kyle S. Goodwin Sent: 01 August 2005 16:24 To: RPG programming on the AS400 / iSeries Subject: Re: reading different files according to user input One simplistic solution would be to simply use %EOF rather than %EOF(filename) since I believe that that will check the last result from any file. Kyle Goodwin Quoting Yivi <nardus@xxxxxxxxx>: > Hi there. > > Little newbie question. > > I have a program that produces a statistic report, and that needs to read > one file or another according to user's specification via a parameter. > > But there are some lines of the program where I don't know how to manage to > go along with the choice. > > E.g.: > dow not %EOF(ALFDEALHP); > (The files are either ALFDEALHP or ALFDEALHC) > > In the simpler 'CHAINs' and 'READEs' I can use unelegants but effective IFs, > but doing it around the dow would end up with something ugly. > > In some other language I'd be using a reference in the beggining of the > program for the appropriate file; and then referring to that reference > henceforth. But my newbieness in RPG is making itself, and I''ve been over > the infocenter for a while without good results. > > Hope someone can help. > > Thx. > > I.- > -- > This is the RPG programming on the AS400 / iSeries (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. > > -- Kyle S. Goodwin
As an Amazon Associate we earn from qualifying purchases.
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.