another option is to use a primary read that was being discussed in your
other thread. This removes the If %Eof Leave block but you have to make
sure that you have another read at the bottom of your loop.

pol setll srbpol
if %equal
pol reade srbpol
dou %eof(srbpol)
ohords iflt 30
eval ohsrom = svsrom
endif
pol reade srbpol
enddo
endif

On Tue, Mar 8, 2016 at 3:27 PM, Michael Schutte <mschutte369@xxxxxxxxx>
wrote:

I'm beginning to understand that RPG may be foreign to you. :-)

But you need to provide more information. What's going on in the rest of
your loop that you choose to leave off?

The %EoF built in function will check the status for the last file read.
So if you've read another file after srbpol, and if it hit end of file,
then yes your DOU loop will end prematurely.

That being said you have a flaw in this code.

A Do Until will always execute the do loop at least one time. What
happens if on that first read of SRBPOL hits end of file? Where's your
leave to make sure that do not execute the rest of the loop?

If you have reads going on to other files, you need to put the file name
in the EoF built in function. This needs to be the filename in the FSPECS
that you are reading. It may be easier for you to make it a habit to always
put the file name in the %EoF function.

pol setll srbpol
if %equal
dou %eof(srbpol)
pol reade srbpol
if %eof(srbpol) // you need this to leave when eof
is hit.
Leave
endif
ohords iflt 30
eval ohsrom = svsrom
endif
enddo
endif



On Tue, Mar 8, 2016 at 3:00 PM, Hoteltravelfundotcom <
hoteltravelfun@xxxxxxxxx> wrote:

pol setll srbpol
if %equal
dou %eof
pol reade srbpol
ohords iflt 30
eval ohsrom = svsrom


Pol = order#


actual key of file is

order#
orderline

when running I am only getting one read. Is that correct?

the thing is, I dont have order lines from the previous file read that
header where I get the order#/.

Do I create my own order line values? or should this be working.
--
This is the RPG programming on the IBM i (AS/400 and 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.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.




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.