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



You should be surprised. There is more at play here.

Shared Open Data Path?

Shared storage? (e.g. *DTAARA, USRSPC, parameters)

Are you <really> processing by Key in Program A?

ASIDE: Can you rework EXCPT/O-specs to use UPDATE/%FIELDS?

Brian

On 27/08/2019 13:57, Therrien, Paul via RPG400-L wrote:
Resurrecting this....

I am guessing there is a basic rule of database handling that we broke with this scenario.

The scenario is this:

1. Program A reads Logical File 1 (IBOHDGFN) for update with an order number (Retrieves RRN 7512242).
2. Program A calls program B.
3 . Program B reads Logical File 1 (IBOHDGFN ) for input with a different order number (Retrieves RRN 7512240).
4. Program B ends with *INLR = *ON
5. Control returns to Program A.
5 . Program A executes EXCPT (update) to Logical File 1 (IBOHDGFN ) that does not include the key field. (i.e. Order number is not listed in the 'O' specs)
Error: Duplicate record error: Logical File 1 has duplicate key. RRN 7512242 has same key as RRN 7512240.

Actual error message:

CPF5009 Diagnostic 10 08/26/19 10:52:02.216231 QDBSIGEX QSYS 1010 $_IM235T OMSMODS *STMT
To module . . . . . . . . . : $_IM235T
To procedure . . . . . . . : $_IM235T
Statement . . . . . . . . . : 94000115
Message . . . . : Duplicate record key in member IBOHDGFN.
Cause . . . . . : The output or update operation to member number 1 record
number 7512240 format IBOHDGN0, for member IBOHDGFN file IBOHDGFN in library
OMSMODF, failed. Member number 1 record number 7512242 format IBOHDGN0 has
the same record key as member number 1 record number 7512240 format
IBOHDGN0. If the record number is zero, the duplicate record key occurred
on an output operation. Recovery . . . : Change either record key so that
the keys are unique. Then try your request again.

We were surprised by this outcome.

Should we have been?


-----Original Message-----
From: Therrien, Paul
Sent: Friday, August 9, 2019 1:01 PM
To: rpg400-l@xxxxxxxxxxxxxxxxxx
Subject: RE: EXCPT output RPG

Yes, I have checked that.
At this point I am waiting on the user community to give me a live example of what they are encountering.
The error is intermittent.


-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxxxxxxxx] On Behalf Of Doug Englander
Sent: Friday, August 9, 2019 12:28 PM
To: rpg400-l@xxxxxxxxxxxxxxxxxx
Subject: RE: EXCPT output RPG


Paul,

Did you check to see if the file that is being updated has a LF or SQL Index on it that has a unique key requirement over the fields you are updating? I have seen that happen before.

Doug

--
This is the RPG programming on IBM i (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at https://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: https://amazon.midrange.com



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.