Chapter Contents |
Previous |
Next |
SAS/SHARE User's Guide |
You must first access a SAS data library through a SAS server before you can lock that library or any data object in it.
When you use a LOCK statement to lock a data object, you can open that data object as often as you want and in any mode that you want (for example, to create, replace, update, or read the object), as long as your PROC or DATA step does not conflict with what is allowed by the engine that is used by the SAS server to access the data object.
You release a lock on a data object by using the CLEAR argument in the LOCK statement. To find out if a data object is locked and by whom, use the LIST argument in the LOCK statement.
Syntax |
LOCK
libref<.member-name<.member-type |
.entry-name.entry-type>> <LIST | QUERY | SHOW | CLEAR>; |
If member-type is omitted or it is specified as the value DATA or VIEW, two locks are obtained: one on libref.member-name.DATA and the other on libref.member-name.VIEW.
See Locking SAS Data Objects for more information about how and when a lock is released.
Examples |
lock educlib.mycat.choice1.menu; lock educlib.mycat.choice2.menu; /* Update the two catalog entries as needed. */ lock educlib.mycat.choice1.menu clear; lock educlib.mycat.choice2.menu clear;
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.
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.