Overview [ COBOL/HP-UX Operating Guide for the Series 700 and 800 ] MPE/iX 5.0 Documentation
COBOL/HP-UX Operating Guide for the Series 700 and 800
Overview
Using this COBOL system, you can lock either a single record, a group of
records, or a whole file. When data is locked by one operator, no other
operator can delete or change that data. Details on how to lock data are
given in the section "Including Multi-User Syntax in Your Program" .
If the operator locks the whole file (called an exclusive lock), no other
operator can access that file at all. If the operator is locking records
(either single record locks or multiple record locks) the file is
shareable with other operators. The other operators may also be locking
records in the same file. Each operator can be locking a single record
or multiple records. Any operator can access any data that is not locked
by another operator.
The operator can open several data files at the same time, and can
specify locking for each data file that is opened. However, the operator
is allowed only one type of locking for each file - that is, locking of
the whole file, locking of a single record, or locking of multiple
records.
When you do not explicitly specify locking in your program, the default
locking is used. The default locking in this COBOL system is for files
opened I-O, OUTPUT or EXTEND to become EXCLUSIVE. That is, the whole file
is locked by your program. If, however, your program opens the file for
INPUT, the file becomes shareable, and your program cannot hold record
locks on the file. Other operators can open the file for INPUT. This
default locking is used for each file that your program opens when no
LOCK MODE syntax is included in your program.
You can change the default locking to shareable for files of all
organizations opened INPUT or I-O, and also for sequential files opened
EXTEND with the AUTOLOCK or FILESHARE compiler option. This feature is
included only for compatibility with previous products. We recommend
that in new programs you should explicitly specify the required lock mode
in the SELECT statement.
MPE/iX 5.0 Documentation