Chapter Contents

Previous

Next
SAS/SHARE User's Guide

Types of Locks

There are two ways that a data object can be locked:

explicit lock
one that you set with the LOCK statement or the LOCK command for exclusive access to the data object type. The behavior 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 about using the LOCK statement or the LOCK command, see Locking Objects Explicitly (LOCK Statement) and Locking Explicitly in a SAS Window (LOCK Command).

implicit lock
one that is automatically set on the data object type as required by the SAS operation. The 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, the DATA step with 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 data library (higher-level lock) that contains it, the data library is locked implicitly. An implicit lock gives you and other users shared access to the data library, even though you have exclusive access to the locked data set.


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.