The LOCK Statement and the LOCK Command |
See also: | Locking SAS Data Objects |
Syntax | |
Syntax Description | |
Examples |
Syntax |
LOCK
|
specifies the name of a SAS library that is currently accessed through a SAS/SHARE server.
specifies the name of a member in the library libref that is to be locked.
specifies the type of 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.
writes to the SAS log whether the specified data object is locked and by whom. This argument is optional.
Aliases: | QUERY, SHOW |
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 |
In the following example, the first LOCK statement acquires implicit locks on the SAS library EDUCLIB and on the SAS catalog EDUCLIB.MYCAT. It then acquires an explicit lock on the catalog entry EDUCLIB.MYCAT.CHOICE1.MENU. The second LOCK statement acquires an explicit lock on the catalog entry EDUCLIB.MYCAT.CHOICE2.MENU.
lock educlib.mycat.choice1.menu; lock educlib.mycat.choice2.menu;
In the following example, the first LOCK statement that contains the argument CLEAR releases the explicit lock on the catalog entry CHOICE1.MENU, but it does not release the implicit locks because an entry in the catalog is still locked. The second LOCK statement that contains the argument CLEAR releases the explicit lock on the catalog entry CHOICE2.MENU. Because no catalog entries remain locked, the second statement that contains the argument CLEAR also releases the implicit lock on the SAS catalog EDUCLIB.MYCAT. Because no other members of the library are locked, it also releases the implicit lock on the SAS library EDUCLIB.
/* Update the two catalog entries as needed. */ lock educlib.mycat.choice1.menu clear; lock educlib.mycat.choice2.menu clear;
Copyright © 2007 by SAS Institute Inc., Cary, NC, USA. All rights reserved.