The lock name is a unique identifier for the lock. As far as the DLM is concerned, a lock name internally consists of three parts (IDs for the local and global scope and a string for the lock name). From the user's point of view, the following operands affect the way the internal lock name is formed (LKENQ and LKINF macros).
The NAMRNGE operand is used to specify the global scope of the lock.
NAMRNGE=*OWNSYSTEM
The specified lock name is only valid on the local system.NAMRNGE=*CLUSTER
The specified lock name is valid throughout the cluster.
The SCOPE operator is used to specify the local scope of the lock.
SCOPE=*NAMESPACEID
The specified lock name is used as the internal lock name. The first part (8 bytes) of the specified lock name implicitly forms the local scope. The local scope must be a string. Valid characters are the letters “A..Z”, “a..z”; the digits “0..9” and the special characters “@” and “#”. The maximum length of the lock name is 48 characters.SCOPE=*USERID
The user ID to which the calling task belongs is used to form the internal lock name. The DLM determines the user ID and places it at the start of the lock name. The first part of the specified lock name is not considered to be the local scope. The maximum length of the specified lock name is reduced to 40 characters. Specifying SCOPE=*USERID is an easy way of protecting an application's locks against access by another application. The applications simply have to be started under different user IDs.SCOPE=*GROUPID
The user group to which the calling task belongs is used to form the internal lock name. The DLM determines the user group and places it at the start of the lock name. The first part of the specified lock name is not considered to be the local scope. The maximum length of the specified lock name is reduced to 40 characters.The SCOPE=*GROUPID operand may only be specified if the software product SECOS has been purchased and is operational as otherwise the LKENQ call results in an error.
Specifying this operand is an easy way of protecting an application's locks against access by another application. The applications simply have to be started under different user groups.
The remaining part of a lock name (up to 40 characters) may contain any characters.
The local scope must be formed in accordance with the following rules:
Users are not permitted to form a local scope which starts with the special character “$”.
Users must avoid the prefixes “SYS” and “@” for the local scope. These prefixes are reserved for internal TU applications.