Ask the Expert

Serialize access of a file

I want to know how to serialize access of a file by multiple RPG programs. Multiple RPG programs under different jobs need to read/update the same file but different records. The read/update process needs to be serialized. I think record lock doesn't work because it accesses different records.

The system already handles the files and record locking, if I understand your question. When you chain or read a record of a file open for update, the system locks the record for you. When searching for your record, you may read or chain with the (n) no lock option. (e.g. Chain (n) FileName) When you get the record that you want, you can read or chain to the record again without the (n). This will lock the record and prevent other users from updating the record.

==================================
MORE INFORMATION ON THIS TOPIC
==================================

The Best Web Links: tips, tutorials and more.

Ask your systems management questions--or help out your peers by answering them--in our live discussion forums.


This was first published in March 2002

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: