310 pts.
 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

Software/Hardware used:
ASKED: December 4, 2008  4:30 AM
UPDATED: April 14, 2009  7:10 PM

Answer Wiki:
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 Wiki Answer Submitted:  December 4, 2008  6:14 am  by  Boobesh   15 pts.
All Answer Wiki Contributors:  Boobesh   15 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

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.

 23,625 pts.

 

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

 44,110 pts.

 

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

 10 pts.