Some times While checking MSGW for object / member /
record locks ,I have seen it's locked by itself ...? How
it happen and what action we need to perform if job is
updating / writing a record....?

Answers were Sorted based on User's Feedback



Some times While checking MSGW for object / member / record locks ,I have seen it's locked ..

Answer / guru

Usually a record lock will happen when you read a file
itself. To avoid file locks, use the following ways

1.Read(N)Read with no lock
2.When your file is in update mode and if you use any chain
function, then use Chain(N)

Cheers...

Is This Answer Correct ?    13 Yes 1 No

Some times While checking MSGW for object / member / record locks ,I have seen it's locked ..

Answer / duvara (duvara.cse@gmail.com)

when the file is opened in update mode, when u chain the
same record two time continuously with out any updation bw
2 chains then u can face this problem. because the record
is locked by the first chain operation, so cannot chain the
same record again.

To relese the record simply update that record befor the
next chain/read.

Is This Answer Correct ?    6 Yes 2 No

Some times While checking MSGW for object / member / record locks ,I have seen it's locked ..

Answer / rakesh roshan

This is true because either it must be updating the File or
Writing the record to the file and it places *EXCL Lock .

To handle such exception it depends upon the
Application ,if we want to handle such lock we can chain(N)
extender but then we need to see whether the File it is
writing or updating is having some constraints associated
or not , if yes

then we can handle the exception by using %Status of PSDS
DS and wait for few seconds and Retry it .

Is This Answer Correct ?    2 Yes 1 No

Some times While checking MSGW for object / member / record locks ,I have seen it's locked ..

Answer / kathan

when u open file in update mode the record is automatic lock
to remove these condition u can use in ipc prompt N in H/N/P
entry

Is This Answer Correct ?    1 Yes 1 No

Some times While checking MSGW for object / member / record locks ,I have seen it's locked ..

Answer / roshan.wankar

Before Perform Read operation, use SETLL and check Low
indicator is *ON then record is locked

Is This Answer Correct ?    0 Yes 1 No

Some times While checking MSGW for object / member / record locks ,I have seen it's locked ..

Answer / syam

Two user is trying to write or update same record it is
geting lock.
1. Do change in your program all view and report program
open om Read mode only.
2. Do change in your program before update or write check
record is used by another user or not.

Is This Answer Correct ?    2 Yes 6 No

Post New Answer

More RPG400 Interview Questions

How to get only unique records from a file which contains duplicate data using CPYF command ? Example : FILEA has duplicate records and FILEB is a UNIQUE defined.... and I want to get the data from FILEA to FILEB by eliminating all the duplicate records...

2 Answers  


How can we make use of SETLL operation in CL?

11 Answers  


Explain mdt?

0 Answers  


How can we know running job is batch or interactive?

0 Answers  


suppose we have 10 members in physical file and i have to use 4 out of 10 so how can we read this in RPG

3 Answers   TCS,






can i use UPDDTA command in rpg program in which contains a file

1 Answers   TCS,


what is the procedure and explain about real time scenario.

0 Answers   Adhoc Technologies, Hanuman Automation, HSBC, IBM,


1.find most occurrences of a character. for exm: input:aaabbbbdddddyyy output: d 5 times how can i get that?

13 Answers   HCL,


1) How to define keyed file in CL pgm. 2) How can i read particular records in CL pgm from database file.

2 Answers  


How to update only a field of a PF in an RPG program. I don't want to update the record, only one field.

2 Answers  


parameters cannot be passed in which one??

2 Answers   CTS,


what is the use of sflnxtchg?

0 Answers   IBM,


Categories