|
Two jobs retrieved the same number.
NOTE: Not my code - I just have to work with it. Why it has the
add/z-add combo is unknown.
** Data structure for next system number
** & next temporary reference.
D NextNum DS 14
D NSYSNA 1 7
D NSYSNN 1 7 0
D TMPRNA 8 14
D TMPRNN 8 14 0
C SrGetSys Begsr
C *DTAARA DEFINE SYSNBR NextNum
C *LOCK IN NextNum
C NSYSNA IFEQ *BLANKS
C Z-ADD 1 NSYSNN
C ENDIF
C NSYSNN ADD 1 UPDNBR
C Z-ADD UPDNBR NSYSNN
C OUT NextNum
C Endsr
Roger Harman
COMMON Certified Application Developer - ILE RPG on IBM i on Power
From: RPG400-L <rpg400-l-bounces@xxxxxxxxxxxx> on behalf of Henrik Rützou
<hr@xxxxxxxxxxxx>
Sent: Monday, April 17, 2017 5:38 AM
To: RPG programming on the IBM i (AS/400 and iSeries)
Subject: Re: DTAARA Lock Issue?
The one you mean dosn't work where do he counter start? Does it give the
same number in both jobs or
another or do i restart with zero?
On Mon, Apr 17, 2017 at 3:33 AM, Roger Harman <roger.harman@xxxxxxxxxxx>
wrote:
Only one instance found in *all lib.Roger
Wait time on the job is 30 seconds.
I do like the loop idea. And, of course, specifying AND checking the
indicator - which is not being done in this program.
-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of
Stephen Coyle
Sent: Sunday, April 16, 2017 5:48 PM
To: RPG programming on the IBM i (AS/400 and iSeries)
Subject: Re: DTAARA Lock Issue?
Is there more than one BRDAT1 object in different libraries?
Maybe it's a library list issue.
Just throwing that out there.
On Sun, Apr 16, 2017 at 8:14 PM Steinmetz, Paul <PSteinmetz@xxxxxxxxxx>
wrote:
Roger,
Old and no longer used, but here was are coding.
This was an interactive job.
* NEXT ACCOUNT NUMBER
IBRDAT1 DS
I 1 70NACT#
C *IN59 DOUEQ'0'
C *LOCK IN BRDAT1 59
C END *IN59
C ADD 1 NACT#
C OUT BRDAT1
Paul
-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of
MarkHarman
Sent: Sunday, April 16, 2017 7:10 PM
To: RPG programming on the IBM i (AS/400 and iSeries)
Subject: RE: DTAARA Lock Issue?
Nope. The *LOCK is definitely there.
-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of
S(RPG400-L)
Waterburymight
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
even seem to "work" okay most of the time, but,when two jobs run thiscode
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
--
This is the RPG programming on the IBM i (AS/400 and iSeries)
(RPG400-L)mailing list To post a message email: RPG400-L@xxxxxxxxxxxx Tosubscribe,
unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
http://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxx for any subscription related
questions.
Help support midrange.com by shopping at amazon.com with our affiliate
link: http://amzn.to/2dEadiD
--
This is the RPG programming on the IBM i (AS/400 and iSeries)
(RPG400-L)mailing list To post a message email: RPG400-L@xxxxxxxxxxxx Tosubscribe,
unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
http://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxx for any subscription related
questions.
Help support midrange.com by shopping at amazon.com with our affiliate
link: http://amzn.to/2dEadiD
--
This is the RPG programming on the IBM i (AS/400 and iSeries)
mailing list--
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxx for any subscription related
questions.
Help support midrange.com by shopping at amazon.com with our affiliate
link: http://amzn.to/2dEadiD
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxx for any subscription related
questions.
Help support midrange.com by shopping at amazon.com with our affiliate
link: http://amzn.to/2dEadiD
--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxx for any subscription related
questions.
Help support midrange.com by shopping at amazon.com with our affiliate
link: http://amzn.to/2dEadiD
--
Regards,
Henrik Rützou
http://powerEXT.com <http://powerext.com/>
--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxx for any subscription related
questions.
Help support midrange.com by shopping at amazon.com with our affiliate
link: http://amzn.to/2dEadiD
--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxx for any subscription related
questions.
Help support midrange.com by shopping at amazon.com with our affiliate
link: http://amzn.to/2dEadiD
As an Amazon Associate we earn from qualifying purchases.
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.