Locking and SAS Data Object Hierarchy

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
Hierarchy of SAS Data Object Types
1 SAS library is a collection of one or more SAS files that are recognized by SAS. Each file is a member of the library.
2 Member is a file in a SAS library that can be a SAS data file, a SAS data view, a SAS utility file, or a SAS data catalog.
SAS data file
is a SAS data set that contains the data values and the descriptor information. SAS data files are of member type DATA.
SAS data view
is a SAS data set in which the descriptor information and observations are obtained from other files. SAS data views store only the information that is required to retrieve data values or descriptor information. SAS data views are of member type VIEW.
SAS utility file
is a SAS file that stores information that is exclusive to a component of SAS. For example, SAS/ACCESS descriptors, MDDB (Multi-Dimensional Database) files, and DMDB (Data Mining Database) files.
SAS catalog
is a SAS file that stores many different types of information in smaller units that are called entries. Some catalog entries contain system information, such as the definitions of keys. Other catalog entries contain application information, such as window definitions, help windows, formats, informats, macros, or graphics output.
3 Observation is a row in a SAS data file that contains a collection of data values that are associated with a single entity, such as a customer or a state. Each row (observation) contains one data value for each column (variable) in the data file.
4 Entry is a unit of information that is stored in a SAS catalog.

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
to read data.
update
to change the values of variables.
output
to add new variables with values.
utility
to change the header information of the file.
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.
The following table shows the combinations of objects that are locked, how objects are locked, and the effects on other client operations.
Effects of Object Locking 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.