i would like to know under what circumstance the object
will get locked on AS400.

Answers were Sorted based on User's Feedback



i would like to know under what circumstance the object will get locked on AS400...

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

i would like to know under what circumstance the object will get locked on AS400...

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

i would like to know under what circumstance the object will get locked on AS400...

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

i would like to know under what circumstance the object will get locked on AS400...

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

i would like to know under what circumstance the object will get locked on AS400...

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

Post New Answer

More RPG400 Interview Questions

can anyone say,what is the use of operation extended H/N/P?

2 Answers  


why subproc not run in dftactgrp?????/plz explain

2 Answers   CSC,


1.Suppose my file has 10 fields and I want to make the 2nd field Zeros in all records. And assume I have millions of records and I dont want to read each record and update the desired field with 0. Any other way to do this in one step operation? 2. Assume my file has 100 records and I want to see only first 10 records. Is this possible through LF? 3.I have 3 jobs A B and C. I want to submit B after successful completion of A and want to submit C after successful completion of B. Without using job scheduler or job queue, how can i do that through CL program? 4.What is difference between Bind by copy and bind by reference?

4 Answers   Virtusa,


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 ?

1 Answers  


1. I have2 records in a PF. READ PF DO DSPLY EMPNO RETRN DSPLY EMPNO ENDDO What was the output 2. SETON LR vs RETURN 3. Primary File 4. How to delete a deleted spaces 5. How to read a PF in reverse order in CL 6. I have a object in Lib A, B and C. But it shows in D Lib..Why? 7.

4 Answers   HCL,






I have to change a program. This program is calling a subroutine mor than 100times within it. so will it have any performance issue? if yes than what changes i can make. Thanx for ur valuable answer.

2 Answers  


what is EXCEPT command in rpg and use

1 Answers   Active Brains,


What is the name of default out queue when user logs inn to syatem with valid profile?

3 Answers   IBM,


what is the difference between SETON RT & RETURN?

5 Answers  


1.Are there any errors in the following statement?If so then list them.DTAARA is a data area having a field EMP # and EMPNO is a field in the file EMPPF.Which has one record. READ EMPPF IF %FOUND(EMPPF) IN DTAARA EVAL EMP#=EMPNO OUT DTAARA ENDIF

5 Answers  


Can any body give the code for this quesition? Using the following details write C-Spec code to set Name to"AMMU LABS SYSTEM" D NAME1 S 10 INZ('AMMU') D NAME2 S 10 INZ('LABS') D NAME3 S 10 INZ('SYSTEM') D NAME S 20

5 Answers  


Anybody can explain the difference between SFLCLR & SFLINZ?

7 Answers  


Categories