When will AS/400 record lock?

30 pts.
Tags:
AS/400 Records
Record lock
RPG Record Locks
RPGLE
Hi Guru's , I am new to RPG . I would like to know when record will be locked ? Example-1 : PGMA, using a PF1(Physical file) in input mode , PGMB using a logical file based on PF1, in input mode. In this case record will be locked or not (using read or chain or setll operation codes) ? If I will use pf1 in PGMA as inupt mode and in PGMB as update mode , does record will be locked or not ? I have seen when both the files in both the programs using file type in update modere record has been locked .

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

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

Discuss This Question: 2  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

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
  • philpl1jb
    Assuming that you are using native I/O .. F specs and reads and chains .. not SQL and further assuming that you are not using commitment control A record is locked when it is acquired, as in a chain or read, by a program that has opened the file for Update (not input). It remains locked until - the program ends or the file is closed - the record is updated or deleted - another record is acquired by this program through the same access path. - the record is unlocked Access to a record that is locked will not be possible by another program or job that is attempting to acquire that record for update. A program/job can acquire a locked record when that program/jobs access path is for input. Phil
    49,600 pointsBadges:
    report
  • TomLiotta
    Only a couple things to add that I can think of. SQL will also lock rows that are being updated. And a record is locked when it is acquired for update. That last bit is useful because a program can open a file in update mode and read records without locking them. This is done in RPG IV by specifying CHAIN or any READ op-code with the (N) extender. A lock won't be set until the record is eventually input without the (N) extender. That lets you delay the lock until your program has finished all processing of the data. That is most useful in interactive programming when a user might have a record for a long time. There doesn't seem to be much else to add. Tom
    125,585 pointsBadges:
    report

Forgot Password

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

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

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

Thanks! We'll email you when relevant content is added and updated.

Following