LOCK Command

Places an exclusive lock on a specified data object.
See: Locking SAS Data Objects

Syntax

LOCK
libref<.member-name<.member-type> | <.member-name.entry-name.entry-type><LIST | CLEAR>> ;

Syntax Description

libref
specifies the name of a SAS library that is currently accessed through a SAS/SHARE server.
member-name
specifies the name of a member of the library libref that is to be locked.
member-type
specifies the type of the SAS file to be locked. Valid values are DATA, VIEW, and CATALOG. The default is DATA.
If member-type is omitted or is specified as the value DATA or VIEW, two locks are obtained: one lock on libref.member-name.DATA and the other lock on libref.member-name.VIEW.
entry-name
specifies the name of the catalog entry to be locked.
entry-type
specifies the type of the catalog entry to be locked.
LIST
writes to the SAS log whether the specified data object is locked and by whom. This argument is optional.
Aliases:QUERY

SHOW

CLEAR
releases a lock on the specified data object that was acquired by using the LOCK statement in your SAS session. This argument is optional.
For more information about how and when a lock is released, see Locking SAS Data Objects.

Examples

Example 1

The following LOCK command locks SAS catalog entries of type CMAP. The SAS log will show that one catalog entry has already been locked.
lock mapslib.mapscat.euromap.cmap

Example 2

The following LOCK command releases the lock on the catalog entry EUROMAP.CMAP. The SAS log will show that the lock on this catalog entry has been released and by whom.
lock mapslib.mapscat.euromap.cmap clear