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 |
How can we make use of SETLL operation in CL?
Can anybody tell me the setps to create .csv file in IFS folder on AS/400. I also need to know how I can send this .csv file to PC in xls sheet.....?
Can anybody tell me that why we use option(*nodebugio)in H- Spec?
What is the difference between RPG/400 and RPG4
How to declare the pull button in AS/400..
How can i keyed a flat file in RPGLE
How to read alternative records in a pf by using rpg?
CAN WE READ RECORDS WITHOUT USING SETLL,READ,CHAIN IN RPG?
As Packed veriable store 2 digits in 1 byte and ZONE variable store 1 digit in 1 byte... Please tell me when we have to use Packed and Zone variable...?
Errors in Sql query will be in which state?
Please tell me how to read the records from a file with load an array of size with error conditions(The logic answer for this question is ARR is array of 99 elements Z-ADD 0 IDX *LOVAL SETLL FILE READ FILE 99 *IN99 DOWEQ *OFF IDX ANDLT 99 ADD 1 IDX MOVE FIELD ARR,IDX READ FILE 99 ENDDO).So,Please give me the complete of this code.
What will happen if we r using seton lr after return or vice versa.