Previous Page | Next Page

Data Set Options under OpenVMS

LOCKREAD= Data Set Option: OpenVMS



Specifies whether to read a record if a lock cannot be obtained for the record.
Default: NO
Valid in: DATA step and PROC steps
Category: Observation Control
Engines: CONCUR
OpenVMS specifics: All aspects are host-specific

Syntax
Details
See Also

Syntax

LOCKREAD=YES | NO

YES

indicates that the record must be locked when read. If another process already has the record locked, the read operation fails, and you receive a message that the record is locked by another process.

NO

indicates that records do not have to be locked when they are read. If another process already has the record locked, the data is read but is not locked by the reading process.


Details

The LOCKREAD= data set option controls whether SAS reads a record when the record is locked by another process. This option applies only to data sets that are accessed for input. Examples of accessing a data set for input include using the SET statement and the PRINT and FSBROWSE procedures. This data set option does not apply when you are using, for example, the FSEDIT procedure, which accesses a data set for update.

If you specify LOCKREAD=YES and your job tries to access a locked record, the read operation fails. The severity of the failure depends on your job. If you are using FSBROWSE, and you try to move to a locked observation, a message displays saying that the observation is unavailable. However, you can still move to other observations that are not locked. A more severe failure occurs if you are using a SET statement in the DATA step. If the DATA step encounters a locked record, the DATA step fails, and your data set will probably be incomplete.

CAUTION:
Use LOCKREAD=NO with care.

When you specify LOCKREAD=NO, SAS reads locked records. This can result in obsolete data being read. If you know that the data that you are reading is changing often, do not use LOCKREAD=NO.  [cautionend]

LOCKREAD= is closely related to the LOCKWAIT= data set option, which controls whether SAS waits for a locked record to become available.


See Also

Previous Page | Next Page | Top of Page