Previous Topic: MQ PUT—Put Messages on the QueueNext Topic: MQ INQUIRE—Inquire Attributes


MQ SET—Set Attributes

The ADDRESS MQ SET command sets the queue attributes.

Before calling this command, you must store the attributes in compound variables. This lets you specify a stem variable or use the default stem, and the tail is the attribute name.

This command has the following format:

ADDRESS MQ SET
   {ATTRIBUTES(attributes)}
   [STEM(varSTEM)]
   {CONHANDLE(varHCONN)}
   {OBJHANDLE(varHOBJ)}
ATTRIBUTES(attributes)

Specifies the attributes to set. You can specify all valid attributes.

There are two types of attributes:

Character attributes

The character length is defined with IBM definitions. If the length is greater, then the attribute will be truncated.

TRIGGER_DATA

Sets the trigger data (length - MQ_TRIGGER_DATA_LENGTH).

Integer attributes
INHIBIT_GET

Controls whether to allow GET operations.

Valid values: 0 - 1

0

enable

1

disable

INHIBIT_PUT

Controls whether to allow PUT operations.

Valid values: 0 - 1

0

enable

1

disable

TRIGGER_CONTROL

Sets the trigger control.

Valid values: 0 - 1

0

enable

1

disable

TRIGGER_DEPTH

Sets the trigger depth.

Valid values: 1 - 999999999

TRIGGER_MSG_PRIORITY

Sets the threshold message priority for triggers.

Valid values: 0 - MaxPriority

MaxPriority

Maximum message priority supported by the queue manager.

Lowest: 0

Highest: MaxPriority

TRIGGER_TYPE

Sets the trigger type.

Valid values: 0 – 3

0

none

1

first

2

every

3

depth

Note: To see full description of attributes, see IBM WebSphere MQ Application Programming Reference, where character attributes are prefixed with MQCA_ and integer attributes with MQIA_.

STEM(varSTEM)

(Optional) Defines the stem of the compound variable that stores the attributes. If omitted, MQ will be used.

Attributes are read from this variable and set by the MQ SET command.

Default: MQ

CONHANDLE(varHCONN)

Defines the variable name that stores the connection handle.

OBJHANDLE(varHOBJ)

Defines the variable name that stores the object handle.

Examples: Use MQ SET to Set Attributes

This example inhibits messages from being put on the queue and omits the STEM keyword.

MQ.INHIBIT_PUT = 1 
address MQ "SET CONHANDLE(HCONN) OBJHANDLE(HOBJ)",  
           "ATTRIBUTES(INHIBIT_PUT)" 

This example allows messages to be put on the queue and sets the trigger data field.

SET.INHIBIT_PUT = 0 
SET.TRIGGER_DATA = "MQTEST" 
address MQ "SET CONHANDLE(HCONN) OBJHANDLE(HOBJ)", 
           "ATTRIBUTES(INHIBIT_PUT, TRIGGER_DATA) STEM(SET)"