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



Nope. The *LOCK is definitely there.

-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Mark S Waterbury
Sent: Sunday, April 16, 2017 1:41 PM
To: rpg400-l@xxxxxxxxxxxx
Subject: Re: DTAARA Lock Issue?

Roger:

Perhaps someone forgot to specify "*LOCK" on the IN statement, so you
could have something like this example:

D DataArea DS DtaAra(NextNumber)
D NextNbr 15P 0 INZ
...
C IN DataArea
C ADD 1 NextNbr
C OUT DataArea
C MOVE NextNbr Result

and thus, no protection from multiple jobs simultaneously accessing and
updating that data area. This will compile and run "just fine" and it
might even seem to "work" okay most of the time, but,when two jobs run
this code at the same time, you could experience exactly the issue you
reported.

What is needed is:

C *LOCK IN DataArea
C ADD 1 NextNbr
C OUT DataArea
C MOVE NextNbr Result

Hope that helps...

Mark S. Waterbury

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.