Previous Topic: ENABLE termnameNext Topic: INQINPUT termname [WAIT|NOWAIT]


ENQ termname [TEST|WAIT|NOWAIT]

Use this command to enqueue a virtual terminal or test for terminal ownership. Note that this command is not allowed in any AOF rules with the exception of request rules.

The operands have the following meanings:

WAIT

If you specify WAIT or no operand, control is not returned until the virtual terminal is owned.

TEST

If you specify TEST, control is returned immediately and the return code is set to indicate the ownership status.

NOWAIT

If you specify NOWAIT, ownership of the virtual terminal is assigned if it is immediately available; otherwise, no ownership is assigned.

Note: You must perform multiple ENQs in ascending order by terminal name.

If DEQ is not called after an ENQ, the virtual terminal is automatically dequeued when the REXX program ends.

ENQ TERM1
Return code:
  0 - Normal completion:
      For WAIT - ownership has been assigned.
      For TEST - terminal was available without wait.
      For NOWAIT - ownership has been assigned.
  4 - ENQ command not executed. A warning message was issued.
      No enabled terminals found to ENQ (ENQ ALL).
      Terminal is not defined.
      Terminal is disabled.
      You are already enqueued on terminal.
      You already have an ENQ pending for this terminal.
 12 - ENQ failed. An error message was issued.
      Terminal is already enqueued by another user.
      Conflict with another ENQ you issued previously.
      ENQ request area GETMAIN failed.