MQCONNX (Connect queue manager (extended)) on IBM i

The MQCONNX call connects an application program to a queue manager. It provides a queue manager connection handle, which is used by the application on subsequent IBM MQ calls.

The MQCONNX call is like the MQCONN call, except that MQCONNX allows options to be specified to control the way that the call works.

On IBM MQ for Windows, UNIX, and IBM i, each thread in an application can connect to different queue managers. On other systems, all concurrent connections within a process must be to the same queue manager.


Syntax

MQCONNX (QMNAME, CNOPT, HCONN, CMPCOD, REASON)


Parameters

The MQCONNX call has the following parameters:

    QMNAME (48-byte character string) - input

    Name of queue manager.

    See the QMNAME parameter described in MQCONN (Connect queue manager) on IBM i for details.

    CNOPT (MQCNO) - input/output

    Options that control the action of MQCONNX.

    See MQCNO (Connect options) on IBM i for details.

    HCONN (10-digit signed integer) - output

    Connection handle.

    See the HCONN parameter described in MQCONN (Connect queue manager) on IBM i for details.

    CMPCOD (10-digit signed integer) - output

    Completion code.

    See the CMPCOD parameter described in MQCONN (Connect queue manager) on IBM i for details.

    REASON (10-digit signed integer) - output

    Reason code qualifying CMPCOD.

    See the REASON parameter described in MQCONN (Connect queue manager) on IBM i for details of possible reason codes.

    The following additional reason codes can be returned by the MQCONNX call:

    If CMPCOD is CCFAIL:

      RC2278
      (2278, X'8E6') Client connection fields not valid.

      RC2139
      (2139, X'85B') Connect-options structure not valid.

      RC2046
      (2046, X'7FE') Options not valid or not consistent.


RPG Declaration

     C*..1....:....2....:....3....:....4....:....5....:....6....:....7..
     C                     CALLP     MQCONN(QMNAME : HCONN : CMPCOD :
     C                                      REASON)
The prototype definition for the call is:
     D*..1....:....2....:....3....:....4....:....5....:....6....:....7..
     DMQCONN           PR                  EXTPROC('MQCONN')
     D* Name of queue manager
     D QMNAME                        48A
     D* Options that control the action of MQCONNX
     D HCONN                        224A
     D* Connection handle
     D HCONN                         10I 0
     D* Completion code
     D CMPCOD                        10I 0
     D* Reason code qualifying CMPCOD
     D REASON                        10I 0
Parent topic: Function calls on IBM i