NET/MASTER Network Control Language (NCL) Reference Manual

LOCK
Verbs
106126 Tandem Computers Incorporated 3–115
LOCK The LOCK verb obtains or releases access to a resource (such as a record in a file). It
allows an NCL process to specify a resource by name and requests that it be given
either exclusive or shared access to that resource. This controls concurrent access to a
particular resource by different NCL processes. Other NCL processes that wish to
gain access to the resource use this verb to determine whether the resource is available.
A resource is a term used in connection with the LOCK verb and is not a real entity
such as a file or a variable. A resource in this context is a name to which one or more
NCL processes refer. The name is made up of a primary section (PNAME) and
optionally a minor section (MNAME), separated by a period (.). In the following
example, ABC is the primary name, and RECORD1 is the minor name:
ABC.RECORD1
For example, two NCL processes use the resource ABC.RECORD1 to control their
access to a UDB containing records that each process needs. Each process would
request exclusive use of the resource ABC.RECORD1. While one was granted access,
the other would fail to obtain access and would therefore not attempt to use the UDB.
Note LOCK facilities provide protection only if all NCL processes that need to synchronize access to a resource
call the resource by some name, and use LOCK against that resource name.
The &SYS.RETCODE system variable is set on completion of the LOCK verb and
indicates the result of the operation. The value that NCL places in &SYS.RETCODE
depends on the choice of operands used with this verb. In addition, depending on the
value placed in &SYS.RETCODE, the &SYS.FDBK system variable is set by NCL to
contain supplementary information. See the considerations for this verb for details
about the settings of these two system variables.
LOCK PNAME=
primaryname
[ MNAME=
minorname
]
[ TEXT=
text
]
[ TYPE={ EXCL | FREE | SHR | TEST } ]
[ VARS=
variable-name
]
[ WAIT={ NO | YES |
nnnn
} ]
PNAME=
primaryname
specifies the primary name of the resource that is the subject of the LOCK action.
This operand is required. It is restricted to 250 characters.
MNAME=
minorname
specifies the minor name of the resource that is the subject of the LOCK action.
This operand is optional. It is restricted to 250 characters.