SAS Component Language Dictionary |
Category: | SAS Table |
Syntax | |
Details | |
Example | |
See Also |
Syntax |
sysrc=UNLOCK(table-id); |
contains the return code for the operation:
0 | |
0 |
is the identifier that was assigned when the table was opened. If table-id is invalid, the program halts.
Details |
A table that is opened in UPDATE mode receives RECORD-level locking by default. Whenever an application reads a row from a table that was opened in UPDATE mode, it attempts to obtain a lock on the row. All of the following functions lock a row when the table is opened in UPDATE mode:
DATALISTC | DATALISTN | FETCH | FETCHOBS | LOCATEC | LOCATEN |
Row locks are implicitly released when a different row is read. However, when a user is finished with a row but has not read another row, you can use UNLOCK to explicitly release a lock on the row.
This function is useful when rows from a secondary SAS table are read to obtain values.
Note: UNLOCK is not directly related to the LOCK function, which locks SAS catalogs, catalog members, and SAS tables. However, if the table in question is accessed through SAS/SHARE software using the REMOTE engine, then UNLOCK can be used to enable other applications to access individual rows. See SAS Language Reference: Dictionary for more information.
Example |
Call FETCH to read a new row from the SAS table MYDATA, which is opened in UPDATE mode. After data from the row is processed, call UNLOCK to release the lock on the row.
dsid=open('mydata','u'); rc=fetch(dsid); ...more SCL statements... rc=unlock(dsid);
See Also |
Copyright © 2009 by SAS Institute Inc., Cary, NC, USA. All rights reserved.