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
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.
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
Question – are any of the fields you are updating part of the key?