swirl
Guide to OmniMark 8   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesLegacy LibrariesErrors
 
  Related Syntax     Other Library Functions  
function  

mq-open

 
 

Library: MQSeries access (OMMQI) legacy
Include: ommqi.xin
Return type: mq-queue

Returns: A configured mq-object.


Declaration

define external mq-object function mq-open
  connection             value            mq-connection       connection
  object-descriptor    value            mq-object-descriptor   MQOD
  options              value            integer                options

Argument definitions

connection
is a connected mq-connection object.
MQOD
is a configured mq-object-descriptor object.
options
is a union of options with which we want to open the specified IBM MQSeries object.


Purpose

Use mq-open to create a connection to an IBM MQSeries object, typically a queue.

Requirements

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

  include "ommqi.xin"

The connection object must be connected (else external exception OMMQI0011).

Usage Notes

This function corresponds to the MQOPEN function in the MQSeries API.

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

Example

Create a connection to queue "default" through queue manager "QM_desthost" for both putting and getting messages.

  include "ommqi.xin"
  
  process
     local mq-connection     a-connection
     local mq-object             a-object
     local stream               od-fields    variable
     local mq-object-descriptor a-mqod
  
     ; Connect to queue manager QM_desthost
     set a-connection to mq-connect to "QM_desthost"
  
     ; Set up MQOD structure
     set new od-fields {"ObjectName"} to "default"
     mq-set-object-descriptor a-mqod to od-fields
  
     ; Open queue
     set a-object to mq-open connection a-connection
            object-descriptor a-mqod
            options (MQOO_OUTPUT union MQOO_INPUT_AS_Q_DEF)

    Related Syntax
   mq-close
 
  Other Library Functions
   mq-backout
   mq-close
   mq-commit
   mq-connect
   mq-connection
   mq-connectx
   mq-disconnect
   mq-get
   mq-get-entire-return-status
   mq-get-function-status
   mq-get-logging-level
   mq-get-throw-on-warnings
   mq-inquire
   mq-inquire-names
   mq-object
   mq-open
   mq-put
   mq-put1message
   mq-set
   mq-set-logging-level
   mq-set-throw-on-warnings
 
 

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

OmniMark 8.2.0 Documentation Generated: March 13, 2008 at 3:27:39 pm
If you have any comments about this section of the documentation, please use this form.

Copyright © Stilo International plc, 1988-2008.