× 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'm not sure I follow the purpose of "granularity" in this scenario. Are
you advocating for the WAITRCD(800) override to replace the existing
looping logic? The two advantages I see are that 1) the looping logic is
eliminated and, 2) the 20 second "sleep" time is eliminated, allowing
processing to continue as soon as the record is unlocked by the other job.

If the lock still exists after WAITRCD(800) expires, I'd still process the
error.

- Dan

On Wed, Nov 1, 2023 at 5:36 PM Jon Paris <jon.paris@xxxxxxxxxxxxxx> wrote:

I can only think that you get more granularity of control with a wait. I
would use the sleep() or usleep() functions rather than wasting machine
respource on a loop.

In the past, I used this approach when the norm was a small delay for the
lock but we would increase the wait time on each iteration until a sanity
limit was reached at which point we worked out who had the lock and shouted
at them!

Jon P

On Nov 1, 2023, at 12:48 PM, Dan <dan27649@xxxxxxxxx> wrote:

I’m reviewing an old RPGLE batch program that has logic to retry a CHAIN
on
an update file whenever the CHAIN fails because the record is locked by
another job. It uses a loop to wait 20 seconds and retry the CHAIN, and
it
loops ten times. And I’m left wondering why one wouldn’t just override
the
WAITRCD value for the file before opening it. We use the system default
WAITRCD(60), so the logic currently waits 80 seconds in total (60+20)
between each attempt, and gives up after 800 seconds. Is there a good
reason why overriding with WAITRCD(800) and doing away with the current
loop logic wouldn’t be a better option? I’m going to guess that the
original developer wasn’t aware of files’ WAITRCD attribute.

(And, yes, the logic does process the error after exiting the loop.)

- Dan


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.