Obtain and Release Table Lock

The command INGRDS allows you to obtain and release a lock for a specific table. A lock is a token with a maximum length of 16 bytes. A lock token must not contain blanks. A lock token cannot be the empty string.

The token 'UNLOCKED' is reserved and should not be used as lock token.

The purpose of the table lock is to protect a table from modification while another user has access to it. For example if you edit the table on TSO via command 'INGRCRDX EDIT table' the table will be locked with the corresponding TSO user id.

If a table already has a lock the following subcommands are rejected with return code 102 if the lock does not match the token specified via parameter TOKEN:
DROP, INSERT, UPDATE, DELETE, IMPORT
For example, the following command deletes the table if the table has the lock 'JOB$ABC':
INGRDS DROP table TOKEN(JOB$ABC)
Note: The lock token associated with a table is much less restrictive than, for example, an ENQ lock. The lock token is not associated with a task or an address space. It is like an attribute of the table that can be set or removed. Any NetView operator or TSO user (that is allowed to use INGRCRDX) can set or remove the lock token. Therefore it might be possible (but not recommended) by a NetView operator or a TSO user userid to set manually the lock token to JOB$userid2, where userid2 is a foreign TSO userid. Of course, in this case, the TSO user userid2 is able to access and overwrite the table although it was locked by userid1. Also it is recommended that you do not use a lock token that starts with NETV$ or JOB$ yourself.