Previous Page | Next Page

WebSphere MQ Call Routines

MQPUT



Puts a message on a WebSphere MQ queue that has been previously opened.
Syntax
Arguments
Example

Syntax

CALL MQPUT(hConn, hObj, hmd, hpmo, hData, compCode, reason <, compCode1, reason1, compCode2, reason2, ...>);

Arguments

hConn

Numeric, input

Specifies the WebSphere MQ Connection handle that is obtained from a previous MQCONN function call.

hObj

Numeric, input

Specifies the WebSphere MQ handle to an open object that is obtained from a previous MQOPEN call.

hmd

Numeric, input

Specifies the Base SAS internal message descriptor handle that is obtained from a previous MQMD function call.

hpmo

Numeric, input

Specifies the Base SAS internal put message options handle that is obtained from a previous MQPMO function call.

hData

Numeric, input

Specifies the Base SAS internal data descriptor handle that is obtained from a previous MQSETPARMS function call. If set to zero, then it is assumed that no data will accompany this message. For WebSphere MQ Version 5.1 and later, hData can also represent a reference message header that is obtained from a previous MQRMH function call.

compCode

Numeric, output

Returns the WebSphere MQ completion code. This parameter can be used to determine whether an error occurred during the execution of this routine. If an error occurred, then the compCode parameter will be nonzero, and the reason parameter will be set to the appropriate reason code.

reason

Numeric, output

Returns the WebSphere MQ reason code that qualifies compCode.

Note:    A reason code of -1 reflects a Base SAS internal error, not a WebSphere MQ error. To obtain a textual description of a failure (either Base SAS or WebSphere MQ), use the SYSMSG() Base SAS function call.  [cautionend]

compCodex, reasonx

Numeric, output

The compCodex and reasonx are an optional series of paired values that can be used when opening a distribution list in order to discern failures for specific queues within the distribution list. These parameters support features of WebSphere MQ Version 5.1 and later.


Example

This example sends a message to a queue.

compCode=0;
reason=0;
CALL MQPUT(hConn, hObj, hmd, hpmo, hData,
compCode, reason);

Previous Page | Next Page | Top of Page