Chapter Contents


SAS/SHARE User's Guide

LOCK Command

The LOCK command enables you to specify the name of the data object to be locked on the command line of a window, such as the SAS Display Manager System's Program Editor window. You must first access a SAS data library through a SAS server before you can lock that library or any data object in it.


LOCK <data-object

specifies the data object to be locked. A data object can be a SAS data library, a SAS data file, a SAS data view, a SAS catalog, or a SAS catalog entry. The general form of this argument is

libref<.member-name<.member-type |

is a valid SAS name that refers to a SAS data library that is currently accessed through a SAS server.

is a valid SAS name that specifies a member of the SAS data library associated with the libref.

is the type of the SAS file to be locked. Valid values include 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 on libref.member-name.DATA and one on libref.member-name.VIEW.

is the name of the SAS catalog entry to be locked.

is the type of the catalog entry to be locked.

writes to the SAS log whether the specified data object is locked and by whom. These arguments are optional.

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


On the command line of the Program Editor window, enter:

lock mapslib.mapscat.euromap.cmap
lock mapslib.mapscat.euromap.cmap clear 

The first LOCK command locks SAS catalog entries of type CMAP. The SAS log will indicate that one catalog entry has already been locked.

The second LOCK command releases the lock on the catalog entry EUROMAP.CMAP. The SAS log will indicate that the lock on this catalog entry has been released and by whom.

Chapter Contents



Top of Page

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