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



I am coming in late to this thread so I may be missing the point of the original
question, but why not just monitor %error and %status = 1218 in the RPG program
and issue a retry to the read or chain?

Another thing that I have done is change the default reply on RNQ1218 to an R so
if a user does hit the enter key (which they almost always do when this error
comes up) it will retry the chain or read instead of canceling out of the
program.

----- Original Message ----- 
From: "Christen, Duane J." <dchristen@xxxxxxxxxxxxx>
To: "'RPG programming on the AS400 / iSeries'" <rpg400-l@xxxxxxxxxxxx>
Sent: Tuesday, June 20, 2006 11:36 AM
Subject: RE: Condition handler and lock waits - Retry! Retry!


Larry;

<snip>
But all of these options are simply combinations of moving the resume cursor
and continuing, or cancelling back to a point and continuing. Why is the
retry option offered to the person least qualified to decide whether to take
it? :-)

There must be a way.

Cheers

Larry Ducie
</snip>


There is but IBM does not provide an interface with enough granularity to
allow you to do it "systematically". What you want to do is catch the
RNQ1218 inquiry message and automatically process it, but IBM only allows
you to do this system wide, AFAIK. So you have to emulate what IBM does deep
down in the compiled RPG code/condition handler(s):

IBMs Way:
1. Read a record
2. CPF5027 exception produced by DB
3. RNX1218 issued by RPG condition handler which caught CPF5027
4. RNQ1218 issued by RPG (?) condition handler which caught RNX1218
4A. Depending on the reply to RNQ1218 do something. If it is "R" go back to
step 1.
...

AFAIK you can't set the resume cursor to the previous/last statement ran, so
you have to roll your own.

My Solution:
1. setjmp
1A. Read a record
2. CPF5027 exception produced by DB
3. CPF5027 caught by user condition handler. Message sent on 3rd retry
otherwise longjmp issued to return to step 1.
...

If anyone has a better process I would like to know what it is.


Duane Christen



NOTICE: This electronic mail transmission may contain confidential
information and is intended only for the person(s) named.  Any use, copying
or disclosure by any other person is strictly prohibited. If you have
received this transmission in error, please notify the sender via e-mail.




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.