1,025 pts.
 AS400 – File
I wanted to do

Chain Kfld File1

If Found And Fld1 = 'Y'

   Update File

Else

  Perform Next Chain Operation

Endif

Here I wanted to perform the Chain without Locking the Record. I wanted to perform Update Operation without Performing Read/Chain again if the Condition is True. How to achieve this?



Software/Hardware used:
ASKED: February 22, 2011  2:05 PM
UPDATED: February 26, 2011  3:24 AM

Answer Wiki:
Take a look at Chain(n). N modifier doesn't lock the record. Another way is to use SETLL and READ in a loop and when you found your record proceed to use the CHAIN method for update. Regards.
Last Wiki Answer Submitted:  February 22, 2011  2:55 pm  by  Mariodlg   2,790 pts.
All Answer Wiki Contributors:  Mariodlg   2,790 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


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


 

I wanted to perform the Chain without Locking the Record. I wanted to perform Update Operation without Performing Read/Chain again if the Condition is True.

Those two are mutually exclusive.

How to achieve this?

You can’t. The update operation must lock the record. The whole database system would be impractical if it didn’t.

Tom

 108,310 pts.

 

If you update, you need to chain or read with a lock.
Perhaps you want to unlock when you do not update?
Then you will leave no record locked where you did not update.
Good Luck

 695 pts.