Previous Topic: PPQ Operations CommandsNext Topic: READ Command


LOCK Command

The LOCK command prevents access to a queue by REXX programs other than the current one. It provides a means for handling problems that can arise from the multiple access situations created by the multitasking environment. Using LOCK is necessary only when you are writing multiple items that must be sequential in the queue.

This command has the following format:

ADDRESS PPQ 'LOCK QUEUE(qname) [WAIT(NO|YES|waittime)]'
QUEUE

Specifies the 1- to 16-character name of the queue (qname). The queue name can contain alphanumeric characters and any of these special characters: ! @ # $ _

The queue name cannot contain blanks.

WAIT

(Optional) Specifies what the command does if it cannot execute immediately. For example, the queue may be in use or locked by another REXX program. Valid WAIT values are:

NO

Returns a nonzero return code (RC) value immediately. For information about what happens when a command does not execute successfully, see the chapter on using program-to-program queues in the Administrator Guide.

YES

Waits indefinitely while blocking the current REXX program until the queue becomes available.

waittime

Specifies the number of seconds to wait (up to 100000) while blocking the current REXX program. Fractional values (such as 1.5) are valid.

Default: NO

Usage Notes: