|
I found the problem, I was issuing a READ op code the first time, I just changed to READE and searched the file by item. It now loads in 1 second! Thanks Justin Houchin Programmer Reliatek, Inc ----- Original Message ----- From: "Justin Houchin" <jhouchin9@charter.net> To: <rpg400-l@midrange.com> Sent: Friday, April 12, 2002 10:50 AM Subject: Re: Reading Files > Let me restate my questions with a little more detail. I have one program > that will display a list of inventory items and there quantities. To > calculate the inventory quantities I have created a procedure that I call to > calculate the quantities and then return a value. The problem is that when > the procedure reads through all of the individual items calculating > quantities it will reach the EOF and return the vaule back to the main > program. OK, the value comes back correctly for the first item. But now it > starts the do loop back again calling the procedure again to calculate > another quantity for a different item, the procedure thinks that the > inventory physical file is still at the EOF position, therefore not reading > it and not returning a value. I corrected the problem by inserting SETLL > before the read in the procedure. Now the program works but it is Slow and I > think it is because of the SETLL. Is there a way that I can release the EOF. > > Justin Houchin > Programmer > Reliatek, Inc > ----- Original Message ----- > From: <Mike.Collins@syan.co.uk> > To: <rpg400-l@midrange.com> > Sent: Friday, April 12, 2002 10:29 AM > Subject: Re: Reading Files > > > > > > That depends on whether you share the open data path when you open the > file > > (the SHARE on either the CRTPF/LF or OVRDBF commands). If a file is opened > > with SHARE(*YES) then if program A has read say the first record in the > > file, if you then call program B and read the same file it will read the > > SECOND record. Specifying SHARE(*YES) can be more efficient, but you need > > to design your system so as to allow for the previous scenario. If ni your > > case the file is opened SHARE(*NO) then when you issue your first read, > yes > > it will read the first record in the file, in terms of either the key or > > the RRN, depending on how the file is defined in the RPG. > > > > _______________________________________________ > > This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list > > To post a message email: RPG400-L@midrange.com > > To subscribe, unsubscribe, or change list options, > > visit: http://lists.midrange.com/cgi-bin/listinfo/rpg400-l > > or email: RPG400-L-request@midrange.com > > Before posting, please take a moment to review the archives > > at http://archive.midrange.com/rpg400-l. > > > > > > > _______________________________________________ > This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list > To post a message email: RPG400-L@midrange.com > To subscribe, unsubscribe, or change list options, > visit: http://lists.midrange.com/cgi-bin/listinfo/rpg400-l > or email: RPG400-L-request@midrange.com > 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 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.