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 if we want to update the data in cl what we will do?
One of the job in subsystem is in Running status,expected time to complete this job is 2 minutes. But from last 5 -10 minutes this job is still in running status....What are the possible reasons...and What are the actions i need to perform to check this...?
How to read a record from file where there is multiple record occurrence is available?
parameters cannot be passed in which one???
1.If *HIVAL SETGT is used what opcode is used to read a record? A:READ B:READPE C:CHAIN D:READP 2.How to pass numeric parameter to the rpg pgm from the command line? 3.What keyword is used on the rpg 4 definition specification to rename a subfile in an externally definition data structure? A:RENAME B;LIKE C:EXTNAME D:EXTFLD
Im traying to get out put of this below mention simple logic code.But im geting out of different.(im trying with my laptop trhough my company server. DCL &FIELD1 *CHAR 10 VALUE('TCS AS/400') DCL &FIELD2 *CHAR 10 CHGVAR(%SST(&FIELD2 1 10))(%SST(&FIELD1 10 1) Can you tell me the value of field2 after excuted of CHGVAR command.
How to set on/off a group of indicators in a single statement?
What is significance of a file designated as a Primary file in Rpg400 program....also what's use of secoundry file
How do you find whether a record is locked or not?
1.Where we declare Variables in RPG/400,RPGIV,RPGILE.? 2.When do we use D-spec and I-spec in real time ?.what is difference between them?
i want to retrieve record b/w 2 dates in as400
In how many ways a session/device error occurs,,, and what is the remedy for it?