swirl
Guide to OmniMark 9   OmniMark home
docs home 
 
  Related Topics   Other Library Functions  
function  

mq-set

 
 


Declaration

define external function mq-set
  object          value       mq-object   obj
  selectors      read-only   integer    selectors
  integer-vals   read-only   integer    int-shelf optional
  string-vals    read-only   stream     str-shelf optional

Argument definitions

obj
is an IBM MQSeries object returned from a call to mq-open
selectors
is an integer shelf containing the IBM MQSeries selectors we wish to set as its values
int-shelf
is an integer shelf containing the integer values for any MQIA_* selectors
str-shelf
is a stream shelf containing the stream values for any MQCA_* selectors


Purpose

Use mq-set to set one or more attributes of an opened IBM MQSeries object.

Requirements

You must include the following line at the beginning of your OmniMark program:

  include "ommqi.xin"

The IBM MQSeries object represented by obj must be open (else external exception OMMQI0013).

The selectors shelf must contain at least one value (else external exception OMMQI0020).

The values in the selectors shelf must be valid IBM MQSeries selector identifiers (else external exception OMMQI0018).

If any MQIA_* selectors are specified, then the optional integer-vals argument must be present (else external exception OMMQI0021).

If any MQCA_* selectors are specified, then the optional string-vals argument must be present (else external exception OMMQI0021).

Each item in the str-shelf must not be longer than the maximum length specified by the IBM MQSeries API for the corresponding MQCA_* selector (else external exception OMMQI0022).

Usage Notes

This function corresponds with the IBM MQSeries function MQSET. See the IBM MQSeries documentation for MQSET for more information.

The obj parameter maps to both the Hconn and Hobj parameters of MQSET.

The item count for each of the three array parameters to MQSET are not necessary as they are calculated from the corresponding shelves.

The CompCode and Reason parameters of MQSET are integrated into the OMMQI error handling.

Example

Set the access attributes and trigger data of a queue.

     local mq-connection a-connection
     local mq-object               a-object
     local stream                 od-fields           variable
     local mq-object-descriptor   a-mqod
     local integer                selectors           variable
     local integer                int-attribs         variable
     local stream                 stream-attribs      variable
  
     ; Connect to queue manager
     set a-connection to mq-connect to "QM_penguin"
  
     ; Open desired queue
     set new od-fields {"ObjectName"} to "default"
     mq-set-object-descriptor a-mqod to od-fields
     set a-object to mq-open connection a-connection
            object-descriptor a-mqod
            options MQOO_SET
  
     ; Create list of selectors we wish to modify
     set new selectors to MQIA_INHIBIT_GET
     set new selectors to MQIA_INHIBIT_PUT
     set new selectors to MQCA_TRIGGER_DATA
  
     ; Create lists of selector values in same order as selectors
     set new int-attribs to MQQA_GET_INHIBITED
     set new int-attribs to MQQA_PUT_INHIBITED
     set new stream-attribs to "New Trigger Data"
  
     ; Set selector values of the queue
     mq-set object         a-object
            selectors     selectors
            integer-vals  int-attribs
            string-vals   stream-attribs

    Related Topics
 
Other Library Functions
 
 

Top [ INDEX ] [ CONCEPTS ] [ TASKS ] [ SYNTAX ] [ LIBRARIES ] [ LEGACY LIBRARIES ] [ ERRORS ]

OmniMark 9.1.0 Documentation Generated: September 2, 2010 at 1:38:10 pm
If you have any comments about this section of the documentation, please use this form.

Copyright © Stilo International plc, 1988-2010.