The properties of MQBag objects are explained over the following pages.
It is used to set or inquire about the value of an item. Use of this property corresponds to the following MQAI calls:
in the WebSphere MQ Programmable Command Formats and Administration Interface.
|
When inquiring about an item, MQSEL_ANY_USER_SELECTOR is the default. When setting an item, MQIA_LIST or MQCA_LIST is the default.
If the Selector is not of type long, MQRC_SELECTOR_TYPE_ERROR results.
When inquiring about a value of an item within a bag:
Value = mqbag[.Item]([Selector], [ItemIndex])
For MQBag references:
Set abag = mqbag[.Item]([Selector]. [ItemIndex])
To set the value of an item in a bag:
mqbag[.Item]([Selector], [ItemIndex]) = Value
within a bag. This property corresponds to the MQAI call, "mqCountItems," in the WebSphere MQ Programmable Command Formats and Administration Interface.
|
MQSEL_ALL_USER_SELECTORS is the default.
If the Selector is not of type long, MQRC_SELECTOR_TYPE_ERROR is returned.
To return the number of items in a bag:
ItemCount = mqbag.Count([Selector])
bag. This property corresponds to the Options parameter of the MQAI call, "mqCreateBag," in the WebSphere MQ Programmable Command Formats and Administration Interface.
|
When inquiring about the options of an item within a bag:
Options = mqbag.Options
To set an option of an item in a bag:
mqbag.Options = Options
The methods of the MQBag objects are explained over the following pages.
method corresponds to the MQAI calls, "mqAddInteger"and "mqAddString," in the WebSphere MQ Programmable Command Formats and Administration Interface.
|
Depending on the type of Value, MQIA_LIST or MQCA_LIST is the default. If the Selector parameter is not of type long, MQRC_SELECTOR_TYPE_ERROR results.
To add an item to a bag:
mqbag.Add(Value,[Selector])
the attribute to be returned when an administration bag is sent to execute an INQUIRE command. This method corresponds to the MQAI call, "mqAddInquiry,", in the WebSphere MQ Programmable Command Formats and Administration Interface.
|
To use the AddInquiry method:
mqbag.AddInquiry(Inquiry)
bag. This method corresponds to the MQAI call, "mqClearBag,", in the WebSphere MQ Programmable Command Formats and Administration Interface.
|
To delete all data itmes from a bag:
mqbag.Clear
message to the command server and waits for any reply messages. This method corresponds to the MQAI call, "mqExecute,", in the WebSphere MQ Programmable Command Formats and Administration Interface.
|
To send an administration command message and wait for any reply messages:
Set ReplyBag = mqbag.Execute(QueueManager, Command,
[OptionsBag],[RequestQ],[ReplyQ])
into a bag. This method corresponds to the MQAI call, "mqBufferToBag," in the WebSphere MQ Programmable Command Formats and Administration Interface.
|
To load data from a message into a bag:
mqbag.FromMessage(Message,[OptionsBag])
a specified item in a bag. This method corresponds to the MQAI call, "mqInquireItemInfo," in the WebSphere MQ Programmable Command Formats and Administration Interface.
|
MQSEL_ANY_USER_SELECTOR is the default. If the Selector parameter is not of type long, MQRC_SELECTOR_TYPE_ERROR results.
To return the type of a value:
ItemType = mqbag.ItemType([Selector], [ItemIndex])
This method corresponds to the MQAI call, "mqDeleteItem," in the WebSphere MQ Programmable Command Formats and Administration Interface.
|
MQSEL_ANY_USER_SELECTOR is the default. If the Selector parameter is not of type long, MQRC_SELECTOR_TYPE_ERROR results.
To delete an item from a bag:
mqbag.Remove([Selector],[ItemIndex])
specified item within a bag. This method corresponds to the MQAI call, "mqInquireItemInfo," in the WebSphere MQ Programmable Command Formats and Administration Interface.
|
MQSEL_ANY_USER_SELECTOR is the default. If the Selector parameter is not of type long, MQRC_SELECTOR_TYPE_ERROR results.
To return the selector of an item:
OutSelector = mqbag.Selector([Selector], [ItemIndex])
MQMessage object. The reference contains data from a bag. This method corresponds to the MQAI call, "mqBagToBuffer," in the WebSphere MQ Programmable Command Formats and Administration Interface.
|
ToMessage (OptionsBag, Message) |
To use the ToMessage Method:
Set Message = mqbag.ToMessage([OptionsBag])
in a bag. This method corresponds to the MQAI call, "mqTruncateBag," in the WebSphere MQ Programmable Command Formats and Administration Interface.
|
To reduce the number of user items in a bag:
mqbag.Truncate(ItemCount)