MQPUT1
Sends a single message, often a reply, to a queue.
Syntax
CALL MQPUT1(hConn, hod, hmd, hpmo, hData, compCode, reason , compCode1,
reason2, compCode2, reason2, ...>);
Required Arguments
- hConn
-
Numeric, input
Specifies the WebSphere
MQ connection handle that is obtained from a previous MQCONN function
call.
- hod
-
Numeric, input
Specifies the Base
SAS internal object descriptor handle that is obtained from a previous
MQOD function 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 the completion code.
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.
- 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.
Details
Essentially, the MQPUT1
routine performs an MQOPEN, MQPUT and MQCLOSE in one API call. The
queue does not have to be open before you make this call. Also note
that the queue will be closed during the execution of this call.
Example
This example sends a
message to a queue that might not already be opened.
compCode=0;
reason=0;
CALL MQPUT1(hConn, hod, hmd, hpmo, hData,
compCode,
reason);