The following types
of locks can be used on a data object:
is set with the LOCK
statement or the LOCK command for exclusive access to the data object
type. The action of the LOCK statement or the LOCK command is restricted
by the server engine, the object that is being accessed, and the way
that the object is accessed (for example, a data set is locked for
writing).
For details,
see The LOCK Statement and Command.
is automatically set
on the data object type as required by the SAS operation that is being
executed. Each SAS operation has default locking requirements that
are affected by two factors: the data object that is being accessed
and the way that the object is accessed. For example, a DATA step
that includes a MODIFY statement accesses an observation for update,
by default.
Regardless of the type
of lock that is attempted, in order to lock a selected data object,
the server must lock preceding levels of the hierarchy, as needed.
This type of lock is also referred to as an implicit lock.
When you specify a data
object in a LOCK statement, you set an explicit lock on that object.
If you lock a lower-level object without explicitly locking the higher
level or levels, SAS locks the higher level (or levels) automatically.
For example, when you
explicitly lock a SAS data set (lower-level lock) but not the SAS
library (higher-level lock) that contains it, the data library is
locked implicitly. An implicit lock allows other users to access the
locked data library, even though you have exclusive access to the
locked data set.