Question

  Asked: Apr 23 2008   4:33 PM GMT
  Asked by: Gulger99


AS/400 WRITE Op code writes then deletes


RPG, OS/400, AS/400

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?

Subscribe to Alerts! Get questions and answers delivered to your Inbox.


E-mail me updates on this question



   SUBSCRIBE

hidden modal window

Answer Wiki (Improve, edit or add to this answer)


 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0



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

Are you absolutely sure 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.

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.
  • AddThis Social Bookmark Button

Browse more Questions and Answers on AS/400.

Looking for relevant AS/400 Whitepapers? Visit the Search400.com Research Library.


Discuss This Answer


You must be logged-in to discuss a question. Log-in/Register