![]() Chapter Contents |
![]() Previous |
![]() Next |
| UNLOCK |
| Category: | SAS Table |
| Syntax | |
| Details | |
| Example | |
| See Also |
Syntax |
| sysrc=UNLOCK(table-id); |
| 0 | successful |
0 |
not successful |
Type: Numeric
Type: Numeric
| 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. ![[cautionend]](../common/images/cautend.gif)
| 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 |
![]() Chapter Contents |
![]() Previous |
![]() Next |
![]() Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.