Previous Topic: #KEEP SyntaxNext Topic: #KEEP Status Codes


#KEEP Parameters

NOTIFY/SHARE/EXCLUSIVE/UPGRADESHARE/UPGRADEEXCLUSIVE/TEST/RELEASE

Specifies the type of record lock or monitoring.

NOTIFY

Requests that the system monitor database activity associated with the current record type, set, or area specified in the CURRENT parameter, described following. When NOTIFY is specified, the system initializes register 0 to contain information on database activity for the specified record. Only the low-order byte of register 0 will actually contain the value of the five bit flags used to monitor database activity of the specified record.

SHARE

Specifies that the current occurrence of the record type, set, or area specified in the CURRENT parameter, described below, will receive a long-term shared lock.

EXCLUSIVE

Specifies that the current occurrence of the record type, set, or area specified in the CURRENT parameter, described below, will receive a long-term exclusive lock.

UPGRADESHARE

Upgrades a previous #KEEP NOTIFY request by placing a shared long-term lock on the record identified by the LONGID parameter, described below.

UPGRADEEXCLUSIVE

Upgrades a previous #KEEP NOTIFY request by placing an exclusive long-term lock on the record identified by the LONGID parameter, described below.

TEST

Requests that the system return information on database activity associated with the record identified by the LONGID parameter of a previously issued #KEEP NOTIFY statement. The system returns the information to the low-order byte of register 0 as a numeric value.

The TEST request must specify a long-term lock ID that matches the long-term lock ID specified in a previous #KEEP NOTIFY request.

RELEASE

Releases the long-term lock for the record identified by the LONGID parameter, described below. RELEASE also releases the statistics block allocated by a previous #KEEP NOTIFY request.

LONGID=

Specifies either the record locks to be upgraded or the records for which information about database activity is desired.

'ALL'

(#KEEP RELEASE requests only); requests that the system release all long-term locks kept for the logical terminal associated with the current task.

long-id-pointer

Specifies the 1- to 16-character identifier that will be used by subsequent #KEEP requests to upgrade a long-term lock or to make inquiries about database activity associated with the specified record. Long-id is a register that contains the address of the long-term id, the symbolic name of a user-defined field that contains the long-term id, or an absolute expression.

CURRENT=record-name/set-name/area-name

Specifies the record type, set, or area for which the system will monitor database activity or assign a long-term shared or exclusive lock. One of the keywords NOTIFY, SHARE, or EXCLUSIVE must also be specified with the CURRENT parameter. The value of the CURRENT parameter can be a register or the symbolic name of a user-defined field that contains the record name, set name, or area name or the name itself enclosed in quotation marks.

WAIT=

(#KEEP SHARE/EXCLUSIVE/UPGRADESHARE/ UPGRADEEXCLUSIVE requests only); specifies whether the issuing task is to wait if the requested lock cannot be set immediately because of an existing lock on the named

record.

WAIT

(Default); Requests that the system wait for the existing lock to be released in order to set the requested lock. If the wait would cause a deadlock, the system terminates the issuing task abnormally.

NOWAIT

Requests that the system not wait for the existing lock to be released.

NODEADLOCK

Requests that the system wait for the existing lock to be released, unless to do so would cause a deadlock. If the wait would cause a deadlock, the system returns control to the issuing task.

NWTXIT=nowait-on-lock-release-label

Specifies the symbolic name of a routine to which control should be returned if the #KEEP request that specified the NOWAIT option cannot be serviced because the requested lock cannot be set immediately.

DEADXIT=deadlock-label

(#KEEP requests specifying WAIT only);

Specifies the symbolic name of a routine to which control is returned if the requested lock cannot be set immediately, and if to wait would cause a deadlock.

ERROR=error-label

Specifies the symbolic name of a routine to which control should be returned if a condition occurs for which no other exit routine was coded.