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






Ron Power <RPower@xxxxxxxxxx> wrote:

> If it's the last record in the file then it's setting the EOF thus
> causing your problem.

What's setting the EOF condition? Certainly not the SETGT. The RPG
Reference manuals (both RPG/III and ILE RPG) give examples of reading the
highest keyed record in a file by using a SETGT with a key value of *HIVAL,
followed by a READP.

> If the file is keyed by that memo number, why not do a write(e) and catch
the duplicate
> record error, increment the memo number by one each time and loop until
it's written.
> Either that or Setll on the account number and loop till it changes then
increment
> the memo number and write your record.

You could end up with a large amount of I-O. Tony was trying to avoid that
and get away with a single iteration of SETGT, READPE, and WRITE in the
great majority of cases. Occasionally he might need an extra iteration or
two. His approach ought to work, as Rich has demonstrated.

--
Dave...
               _________  ,___o
             __________   _\ <;_        http://www.audax.uk.net
           ___________   (_)/ (_)       http://www.twickenhamcc.co.uk
=======================================================
The opinions expressed in this communication are my own and do not
necessarily reflect those of my employer.


______________________________________________________________________
This message may contain confidential information which may also be legally 
privileged and is intended only for the use of the parties to whom it is 
addressed. If you are not an intended recipient you are hereby notified that 
any disclosure, copying, distribution or use of any information in this e-mail 
is strictly prohibited. If you receive this message in error please notify the 
sender by return e-mail and then destroy it. Further, we make every endeavour 
to keep our network free from viruses. However, you do need to verify that this 
e-mail and any attachments are free of viruses as we can take no responsibility 
for any computer viruses which might be transferred by way of this e-mail. All 
information and attachments remain the property of Stolt Offshore Group and 
should be held as confidential.

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.