AS/400 WRITE Op code writes then deletes

20 pts.
Tags:
AS/400
OS/400
RPG
I have a program where the WRITE op code is not working. After the program runs, there should be records in a file, but instead the deleted records are increased. I have debugged the program and as soon as the WRITE statement is executed the number of deleted records is increased. I've never seen anything like it before. There is no trigger on the file and the records to force a write on the file is 1. Any ideas?
ASKED: April 23, 2008  4:33 PM
UPDATED: April 24, 2008  1:23 PM

Answer Wiki

Thanks. We'll let you know when a new response is added.

That’s really strange. I’m working in RPG in AS400 for many years and I had never heard anything like this.

Are you <b>absolutely sure</b> that the program you are running is the one corresponding to the RPG source? Do you have compiled it yourself? Perhaps you can check also the job stack while in the breakpoint and check the name and library (with SYSREQ, …). Perhaps can exist another pgm with the same name performing a delete instead of a write… (I’m just guessing!). Check for pgm’s with that name in all libraries (WRKOBJ *ALL/pgmname).

Are you really sure that you do not have a trigger associate with that file?

Are you journaling the file? If you are, you can display the “delete” journal entry and see what is the name of the program that is performing the write and the delete (take note: BOTH ENTRIES SHOULD BE IN THE JOURNAL). If do not have a journal, you can create one for the only purpose of finding what is going one with this issue.

Do you have any OVRDBF?

Do you use exit programs?

I’ll be listening for news in this.

<b>Ok – here’s the deal: I found another job running in a different subsystem that was picking up records and deleting them. It shouldn’t have had that library in its list, but did. I’m still amazed at how quickly the update happened though because the other program was on a 5 second delay between I/O. I should have seen a record in the file before it was deleted, but never did.</b>

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following