Locking SAS Data Objects |
SAS Data Object Hierarchy |
The information in this section is primarily directed to applications developers, but it might also be of interest to end users.
Knowing the concepts for locking SAS data objects and the SAS data object hierarchy will help you to understand explicit locking, which is set by using the LOCK statement or a LOCK command; and implicit locking, which is set automatically.
When you perform a SAS operation, the SAS/SHARE server controls which data object is locked and how the data object is locked. This allows you to access data objects and denies access to those data objects by other users for the duration of the operation.
Hierarchy of SAS Data Object Types
Accessing and Using SAS Data Objects |
The type of lock that a server sets on a member or an observation is affected by how the operation accesses and uses the SAS data object type. Here are the ways to access a data object:
input | |
update | |
output | |
utility |
Each SAS operation has a default action for each object that is accessed and the way that the object is accessed. For example, given that the server engine allows an observation to be locked and the observation is not already locked, the server can open and lock an observation in a data set. If the server engine does not allow an observation to be locked, the engine locks the member (above the observation).
The lowest hierarchical level at which data can be locked varies according to the engine that is used to access the data.
V8 and V9 (the default) engines allow locking at the library, member, and observation level.
The V8TAPE engine, V9TAPE engine, and other sequential engines allow locking only at and above the member level.
If an engine does not allow access to SAS catalogs, that engine does not allow locking at any level.
The view engine default-locking action is based on how the view is created, that is by using a DATA step, PROC SQL, or PROC ACCESS (available in SAS/ACCESS). The specific SAS/ACCESS engine that is used is based on the DBMS. See the SAS/ACCESS documentation for information about view engine default-locking action.
Effects of Object Locking on Other Client Operations shows the combinations of objects that are locked, how objects are locked, and the effects on other client operations.
Which Data Object Is Locked | Mode in Which Data Object Is Locked | ||
---|---|---|---|
|
Input | Update | Output |
Member | Other operations can read the data set but cannot open it for update or output. | No other operations can access the data set. | No other operations can access the data set. |
Observation | Other operations can read or update the data set but cannot open it for output. | Other operations can read or update the data set but cannot open it for output. | No other operations can access the data set. |
Copyright © 2007 by SAS Institute Inc., Cary, NC, USA. All rights reserved.