I assume they used the %EOF on the RPG IV READE to echo the RPGIII convention.
Since %FOUND is documented the way you describe it working, I suspect
it's *NOT* a "glitch". READE and %FOUND are unrelated. If you do find a
working relationship, then that would be a "glitch".
Now, whether it *should* work as you'd expect is an entirely different
question and a matter of opinion.
Tom Liotta
In article <20000115100513...@ng-ce1.aol.com>,
--
Tom Liotta
AS/400 systems programmer
Sent via Deja.com http://www.deja.com/
Before you buy.
I had a similar problem with %eof.
Key reade file
dou %eof(file)
Key reade file
enddo
this reads too far, in fact it reads the last record several times. I don't
know why but here is the way I have found to work
Key reade file
dow not(%eof(file))
Key reade file
enddo
This seems to be a misunderstanding of how DOU works. An `until' loop
is guaranteed to execute at least once, and should not be used in the
structure you described. The second version is correct. Note that
`not(%eof(file))' can be rewritten `not %eof(file)' which for my money
is more readable.
____
Paul
Sorry to be hard on you, but I'm always amazed how many people are missing
the knowledge of structured programming.
A DOU executes always 1 to n times, and tests and the end of the block. A
DOW executes always 0 to n times, and tests and the beginning of the block.
Since you can have 0 records, a DOW should be used for reading a file.
Kind regards,
Paul
-------------
C. Robert Jones wrote in message ...
I had a similar problem with %eof.
Key reade file
dou %eof(file)
Key reade file
enddo
this reads too far, in fact it reads the last record several times. I don't
know why but here is the way I have found to work
Key reade file
dow not(%eof(file))
Key reade file
enddo
The contents of this message express only the sender's opinion.
This message does not necessarily reflect the policy or views of
my employer, Merck & Co., Inc. All responsibility for the statements
made in this Usenet posting resides solely and completely with the
sender.