You can use OVRDBF REUSEDLT(*NO) during the recovery.
-----Original Message-----
From: RPG400-L <rpg400-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Robert Wenzel
Sent: Thursday, May 28, 2020 5:47 PM
To: rpg400-l@xxxxxxxxxxxxxxxxxx
Subject: Force SQL Statement In RPG To Insert Records To Next RRN?
CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.
I have DDS Physical files that are multi-member files and are declared REUSEDLT(*YES). Is there a keyword or phrase that will force the next insert to the next RRN without reusing an empty/deleted record?
Why I ask ; I need to have an SQL Insert statement to insert the next record to the end of the file (not a reused RRN). The files do not have unique keys. I cannot modify them. I have an application that will allow a user to delete and then, potentially, recover the deleted records. I catalogue the RRN of the deleted record in an audit file with the original RRN (from the original member) and the new RRN (of the recovery member).
After recovery I catalogue the RRN of the record that was inserted into the original member from the recovery member. The problem occurs if the user deletes, for example, RRN #1 then deletes RRN #2 and then recovers RRN #2. DB2 places the "new" (recovered) record in the RRN #1 location of the
PF. My catalogue now has duplicate RRNs of records that were deleted from
RRN position 1. This should not be the case.
I know I can change the attributes of the PF, even temporarily, but many batch jobs use these files throughout the day. I would prefer an SQL statement directive.
Thank you all.
--
*Robert Wenzel, Software Engineer*
iSeries Applications Support and Development
[image: Inmar]
<
https://www.inmar.com/?utm_source=email%20signature&utm_medium=email&utm_campaign=Associate%20Email%20Signature&utm_content=Inmar%20Logo>
robert.wenzel@xxxxxxxxx
635 Vine Street, Winston Salem, NC 27101
*p: 336-770-3478*
www.inmar.com
<
https://www.inmar.com/?utm_source=email%20signature&utm_medium=email&utm_campaign=Associate%20Email%20Signature&utm_content=URL%20link>
| LinkedIn <
https://www.linkedin.com/company/inmar> | Facebook <
https://www.facebook.com/inmarinc> | Twitter <
https://twitter.com/inmarinc>
--
********************************************
*Inmar Confidentiality
Note*: This e-mail and any attachments are confidential and intended to be viewed and used solely by the intended recipient. If you are not the intended recipient, be aware that any disclosure, dissemination, distribution, copying or use of this e-mail or any attachment is prohibited. If you received this e-mail in error, please notify us immediately by returning it to the sender and delete this copy and all attachments from your system and destroy any printed copies. Thank you for your cooperation.
*Notice of Protected Rights*: The removal of any copyright, trademark, or proprietary legend contained in this e-mail or any attachment is prohibited without the express, written permission of Inmar, Inc. Furthermore, the intended recipient must maintain all copyright notices, trademarks, and proprietary legends within this e-mail and any attachments in their original form and location if the e-mail or any attachments are reproduced, printed or distributed.
********************************************
--
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@xxxxxxxxxxxxxxxxxxxx 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.