Writing Messages to Queues

To write messages to queues in WebSphere MQ, use the following code:

CALL "MQPUT" 
    USING by value HCONN, by value HQUEUE, 
    by reference MSGDESC,PUTMSGOPTS,
    by value BUFFER-LEN, by reference BUFFER-REQ,
    by reference COMPCODE, REASON.

in the following modes:

INPUT Mode:

Variable Description Definition
HCONN S9(9) BINARY handle to queue manager User-defined
HQUEUE S9(9) BINARY handle to queue User-defined
BUFFER-LEN S9(9) BINARY length in bytes of buffer area User-defined

OUTPUT Mode:

Variable Description Definition
BUFFER-REQ Message data area User-defined
COMPCODE S9(9) BINARY returns the completion code User-defined
REASON S9(9) BINARY returns the reason User-defined

I-O Mode:

Variable Description Definition
MSGDESC Structure describes the attributes of the message sent and receives information about the message after sending cmqmdv.cpy
PUTMSGOPTS Options that control the action of MQPUT cmqpmov.cpy