Question

Asked:
Asked By:
Dec 4 2008   4:30 AM GMT
Ambrish 82   210 pts.

AS/400 - Physical File in update mode


CHAIN, Physical File, AS/400 administration

hi all,


i have a physical file i need to update that file (not append) ,I opened that file in update mode
eg
F MYFILE UF E K DISK
(i didn't mention 'A' because i dont need to append records)
now after certain checks i update (any field) with syntex.

UPDATE RECORD FORMAT

but when i run this a dump occurs like '' update without prior I/O operation."
Please tell me where i am wrong

Thanks & regards
Ambrish Srivastava

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



For updating one file . first of all we need to lock that particular record . For that better you can use chain operation to lock. i think it will work
  • 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

Gilly400   23625 pts.  |   Dec 4 2008  9:52AM GMT

Hi,

Before updating a record you will need to read or chain that record to position the file pointer in the program to the correct record in your file. You can use READ, READE, READP, REDPE/READPE, or CHAIN.

Regards,

Martin Gilbert.

 

Philpl1jb   15100 pts.  |   Dec 4 2008  2:03PM GMT

And it’s one update per acquisition of the record
The chain, read, reade, readp, readpe lock the record
The update unlocks the record
So if your code goes:

Chain

CheckFld1
Update

CheckFld2
Update

The second update would fail whenever the record was updated and unlocked in the first instance.

Phil

 

CodeMonkey65708   10 pts.  |   Apr 14 2009  7:10PM GMT

Question - are any of the fields you are updating part of the key?