DEFINE QUEUE: Identifying a WebSphere MQ queue

From m204wiki
Jump to navigation Jump to search

Privileges

System manager or User 0

Function

Identifies a z/OS-WebSphere MQ queue in a queue manager where applications can put (MQPUT and MQPUT1) and get (MQGET) messages. The queue must have been previously defined by the WebSphere MQ administrator.

Syntax

DEFINE {QUEUE | Q} name [LIKE previousname] WITH SCOPE=SYSTEM {QUEUEMANAGER | QM}=qmanentityname [{QUEUENAME | QNAME}=externalqueuename] [options...]

Where

  • name identifies the queue referred to in the Online. name must be:
    • unique, or an error is issued
    • 1-48 characters long and begin with a letter, followed by letters, numbers, periods, or underscores
  • QUEUEMANAGER (or QM) clause names the queue manager for the queue, and must refer to a queue manager previously defined by the WebSphere MQ administrator.

    Use the optional QUEUENAME (or QNAME) clause, if the external name of the queue (as defined to WebSphere MQ) differs from the name you refer to in the Online. External queue names can be up to 48 characters in length. The external queue name is validated when the queue is actually opened. If you omit QUEUENAME (or QNAME), the external name of the queue is assumed to be name.

  • options are default characteristics that are used to manipulate the queues.
    • ACCEPT_TRUNCATED_MSG or NO_ACCEPT_TRUNCATED_MSG (default)
    • ALL_MSGS_AVAILABLE or NOT_ALL_MSGS_AVAILABLE (default)
    • FAIL_IF_QUIESCING or NO_FAIL_IF_QUIESCING (default)
    • CONTEXT
    • EXPIRY
    • FORMAT
    • LOGICAL_ORDER or NOT_LOGICAL_ORDER (default)
    • MSGTYPE
    • PERSISTENT, NOT_PERSISTENT, or PERSISTENCE_AS_Q_DEF (default)
    • PRIORITY or PRIORITY_AS_Q_DEF (default)
    • REPLY_QMGR
    • REPLY_QUEUE
    • REPORT
    • SYNCPOINT (default) or NO_SYNCPOINT
    • WAIT or NO_WAIT (default)
    • WAIT_TIME

Usage

The queue definition has system scope.

Note: Remote queues do not require a DEFINE QUEUE command. Local dynamic queues require a DEFINE QUEUE command only if they were not created by MQ/204 in the current Online job.

DEFINE QUEUE can be omitted if the MQDEQMAN keyword is supplied. (See Parameters and task management for a description of MQDEQMAN.)

When a queue is known to the default queue manager, as specified by the MQDEQMAN keyword, it is possible to omit an explicit DEFINE QUEUE command. Instead MQPUT and MQGET processing can specify the external queue name.

If MQDEQMAN is not specified or the supplied queue name is not valid, the MQPUT or MQGET statement is rejected with the message:

M204.0630: IMPLICIT DEFINE COMMAND REJECTED

Defining local dynamic queues

When a local dynamic queue is created using an MQOPEN statement, it is created with SCOPE=SYSTEM. Model 204 sets up control blocks as if you had defined the queue using the DEFINE command.

If the Online is cycled and the permanent local dynamic queue still exists, to access it in a subsequent run, you must issue a DEFINE QUEUE command with the full name of the local dynamic queue, even if the queue manager created the name when the local dynamic queue was originally defined.

Security considerations

Applications creating local dynamic queues via the OPEN QUEUE statement cannot reference model queues unless the system manager defines the model queues.