Direct MQSeries calls
You can use a set of installed EGL functions that mediate between your code and MQSeries, as described in MQSeries support.
The next table lists the available functions and identifies the required arguments. MQBACK (MQSTATE), for example, indicates that when you invoke MQBACK you pass an argument that is based on the MQSTATE record part. The record parts are described later.
MQSeries-related EGL function invocation Effect MQBACK (MQSTATE) Invokes the system function sysLib.rollback to rollback a logical unit of work. The rollback affects all recoverable resources being accessed by your program, including databases, message queues, and recoverable files. MQBEGIN (MQSTATE, MQBO) Begins a logical unit of work. MQCHECK_COMPLETION (MQSTATE) Sets the mqdescription field of the record that is based on MQSTATE. The setting is based on the last-returned reason code. The function MQCHECK_COMPLETION is called automatically from the EGL functions MQBEGIN, MQCLOSE, MQCONN, MQCONNX, MQDISC, MQGET, MQINQ, MQOPEN, MQPUT, MQPUT1, and MQSET. MQCLOSE (MQSTATE) Closes the message queue to which MQSTATE.hobj refers. MQCMIT (MQSTATE) Invokes the system function sysLib.commit to commit a logical unit of work. The commit affects all recoverable resources being accessed by your program, including databases, message queues, and recoverable files. MQCONN (MQSTATE, qManagerName) Connects to a queue manager, which is identified by qManagerName, a string of up to 48 characters. MQSeries sets the connection handle (MQSTATE.hconn) for use in subsequent calls. Note: Your code can be connected to one queue manager at a time.
MQCONNX(MQSTATE, qManagerName, MQCNO) Connects to a queue manager with options that control the way that the call works. The queue manager is identified by qManagerName, a string of up to 48 characters. MQSeries sets the connection handle (MQSTATE.hconn) for use in subsequent calls. MQDISC (MQSTATE) Disconnects from a queue manager. MQGET(MQSTATE, MQMD, MQGMO, BUFFER) Reads and removes a message from the queue. The buffer cannot be more that 32767 bytes, but that restriction does not apply if you are using the EGL get next statement. MQINQ(MQSTATE, MQATTRIBUTES) Requests attributes of a queue. MQNOOP() Used only by EGL. MQOPEN(MQSTATE, MQOD) Opens a message queue. MQSeries sets the queue handle (MQSTATE.hobj) for use in subsequent calls. MQPUT(MQSTATE, MQMD, MQPMO, BUFFER) Adds a message to the queue. The buffer cannot be more that 32767 bytes, but that restriction does not apply if you are using the EGL add statement. MQPUT1(MQSTATE, MQOD, MQMD, MQPMO, BUFFER) Opens a queue, writes a single message, and closes the queue. MQSET(MQSTATE, MQATTRIBUTES) Sets attributes of a queue. The next table lists the options records that are used as arguments when you invoke the MQSeries-related EGL functions. Also listed is the initialization function that should invoked for a given argument.
Your first step is to initialize the argument that is based on the MQSTATE record part. In the following example (as in the table that follows), the argument name is assumed to be the same as the name of the record part:
MQSTATE_INIT(MQSTATE);
Argument (the record part name) Initialization function Description MQATTRIBUTES none Arrays of attributes and attribute selectors, plus other information used in the command MQINQ or MQSET MQBO MQBO_INIT (MQBO) Begin options MQCNO MQCNO_INIT (MQCNO) Connect options MQGMO MQGMO_INIT (MQGMO) Get-message options MQIIH MQIIH_INIT (MQIIH) IMS information header; describes information that is required at the start of an MQSeries message sent to IMS (MQSeries documentation indicates that use of this header is not supported on Windows 2000/NT/XP) MQINTATTRS none Arrays of integer attributes for use in the command MQINQ or MQSET MQMD MQMD_INIT (MQMD, MQSTATE) Message descriptor (MQSeries version 2) MQMDE MQMDE_INIT (MQMDE, MQSTATE) Message descriptor extension (use only the fields that are in MQSeries version 2) MQOD MQOD_INIT (MQOD) Object descriptor MQOO MQOO_INIT (MQOO) Open options MQPMO MQPMO_INIT (MQPMO) Put-message options MQSELECTORS none An array of attribute selectors, used only if you wish to access MQSeries without use of EGL functions MQSTATE MQSTATE_INIT (MQSTATE) A collection of arguments that are each used in one or more calls to MQSeries; for example, when you connect with the EGL function MQCONN or MQCONNX, MQSeries sets the connection handle (MQSTATE.hconn) for use in subsequent calls MQXQH MQXQH_INIT (MQXQH, MQSTATE) Transmission queue header Note: The record parts each contain only one structure item, and the structure item uses a structure part as a typeDef. This setup gives you maximum flexibility. You can create your own record parts that are each composed of a series of structure parts.
The name of each structure part is the name of the record part followed by _S; the record part MQGMO, for example, uses a structure part named MQGMO_S.
Related concepts
MQSeries-related EGL keywords
MQSeries support
Record parts
Typedef
Related reference
get next
sysLib.commit
sysLib.rollback