UNLOCK

UNLOCK

Top  Previous  Next

 

The UNLOCK command, available only in the QMSYS account, releases task, record or file locks set by any process.

 

 

Format

 

UNLOCK { USER user.no }  { FILE file.no }  { ALL  | record.ids... }

 

UNLOCK { USER user.no }  { FILE file.no } FILELOCK

 

UNLOCK  TASKLOCK lock.no...

 

 

In the first form, UNLOCK releases record ids set by user user.no on file file.no. At least one of these options must be present. The values of user.no and file.no can be found from the output of the LIST.READU command. The UNLOCK requires either a list of record ids or the ALL keyword to determine which records to unlock.

 

In the second form, the file lock set by the specified user on the given file is released. Again, at least one of the USER and FILE options must be specified.

 

The third form allows task locks owned by other users to be released. Any number of locks may be released in a single command.

 

The UNLOCK command is restricted to users with administrator rights and should be used with great care. Locks are taken by application software to protect critical operations. Releasing a lock can cause data integrity problems.

 

 

Example

 

LIST.READU

File  Path

 17  D:\SALES\INVENTORY

File User Type Id

 17    4  RU  18464

 17    4  RU  21968

UNLOCK USER 4 18464

 

In this example, LIST.READU is used to check which locks are outstanding and the UNLOCK command is used to release a specific record lock.