How to Lock Files

HULFT locks file per member.

Different members in the same file can be accessed simultaneously. The behavior of locking file is the same as that of executing object allocation command (ALCOBJ) of IBM i.

Target of locking:

each member

State of locking:

readable exclusive lock (*EXCLRD)

= Remarks =

Usually, apply shared readable lock (*SHRRD) to the Send files. However, when anything other than 'Keep' is specified in the Send File Mode (CLEAR) in the Send Management Information, exclusive lock (*EXCL) is applied to each target of locking.

Where using exclusive file control between HULFT and business application in process of creation is necessary, you can use it by following the procedure given below:

1. Lock

Run ALCOBJ command.

2. Check the locking

Look up the return value of the ALCOBJ command and check whether the locking has completed successfully or not.

3. User processing

Create user processing.

4. Unlock

Run DLCOBJ command.