260 pts.
0
Q:
AS/400 - Physical File in update mode
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
ASKED: Dec 4 2008  4:30 AM GMT
0
15 pts.
0
A:
 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0
  • AddThis Social Bookmark Button
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
Last Answered: Dec 4 2008  6:14 AM GMT by Boobesh   15 pts.
0
0
Discuss This Answer:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _



_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

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   24105 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?

 
0