i would like to know under what circumstance the object
will get locked on AS400.
Answers were Sorted based on User's Feedback
Answer / abhishek kumar
In most of the cases files(*file) will be locked.
Reason: If any program is using that particular file.
| Is This Answer Correct ? | 6 Yes | 1 No |
Answer / samul
File object locked when file open in update mode or file
allocated excl in cl using cmd ALLOBJ.
| Is This Answer Correct ? | 6 Yes | 1 No |
Answer / sankar prosad mohanta
Abhishek is correct, but we can avoid this file locking,
specifying 'N' in 53 position of File Description Spec,
where the file is defined in the program.
| Is This Answer Correct ? | 6 Yes | 2 No |
Answer / keshar jain
@Shankar:
We can use N on position 53 in CHAIN if file is in Update
mode. For other mode we can't specify N.
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / ravi
When a file is declared in UF mode. U - Update, F - Fully procedural file.
When you do a read, it locks the particular record making it unavailable for any other programs. This is to protect the data integrity.
Once you do the update, the lock will be released. If you do not want the lock, you can specify Read(N), but you cannot update. You can also UNLCK opcode to release the lock.
Also, each time you update, you need to lock it.
If you do ALCOBJ you can lock it exclusively. This will not even allow basic functions on the object like read/display. And vice versa too. Any *SHRRD locks like read/display will not allow exclusive lock.
| Is This Answer Correct ? | 2 Yes | 0 No |
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
How Commitment and Roll back control is used in as400, explain with real time senario ???
Q1.How to read the Array? Q2.How to copy the content of one Array to another Array?
In case if I want to know whether a record exists in a file, which one do you prefer CHAIN or a SETLL and why ?
Suppose we add one field in physical file and this physical file is used by several programs.how do we know which program is using that file? What are the impact analysis.
I want to declare the number of elements of an array dynamically in RPGLE ? Is it possible? If yes, then how do I do it ?
Errors in Sql query will be in which state?
what is batch debug in as400?
what is commitment control?explain about it?
How I can reread the physical file in CL program once the end of file reached in same CL program.
Why did we give STRSRVJOB while debugging batch program
Can someone tell me tell me what is meant by message wait...?