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



Hi Ken,

<snip>
When you READC and there are no more changed records, you _are_
attempting to read a record that no longer exists. And IIRC, on older
versions of OS/400 this _would_ put a message in the job log (which is
one of the reasons why I stayed away from it).
</snip>

Maybe older version did do that, but I have tested this on a V5R2 and V5R4
machine and no messages are written to the joblog. I guess it all depends on
whether you are running your code on a release earlier than V5R2 or not.
Personally, I would rather die than do that. Life doesn't begin at 40 it
begins a V5R4. :-)

<snip>
For the OP, since he already has a CHAIN loop, the simplest thing is
to keep a count of the number of subfile records loaded, and only loop
to that number. Then he is _truly_ never attempting to retrieve a
record that doesn't exist. And it doesn't require modifying the DDS
to add SFLNXTCHG.
</snip>

Is this simpler? Maybe it is. But the programmer now always has to ensure
s/he knows how many records are in the subfile and keep that field updated
with the correct value. Not sure if that is simpler than just letting IBM
worry about how many records to read. But, both solutions will work fine and
both will result with no messages in the joblog. That is, after all, what
was required.

As always, there are many ways to perform a simple task on the iSeries - we
have simply put forth two of them.

Cheers

Larry



As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.