Example—MQI DISC
This example highlights disconnecting from the queue manager whose connection handle is stored in variable IMFHCONN.
/* REXX */
'IMFEXEC MQI CONN NAME(CSQ1)' /* Connect to the queue manager*/
IMFMQI_OD_OBJECTNAME = TEST.QUEUE1 /* Set queue name */
'IMFEXEC MQI OPEN OOPTS(MQOO_OUTPUT)' /* Open the queue */
IMFMQI_PMO_OPTIONS = 'MQPMO_SYNCPOINT' /* Set Put options */
PUTDATA = 'MQPUT001 - TEST DATA ECB = MQPUTECB1 POST CODE = PUTECB1'
'IMFEXEC MQI PUT BUFFER(PUTDATA)' /* Put message on queue */
'IMFEXEC MSG 'MQEXAMPL - TEST DATA ECB = MQPUTECB1 POST CODE = PUTECB1''
'IMFEXEC MQI CMIT' /* Commit the work */
'IMFEXEC MQI CLOSE COPTS(MQCO_NONE)' /* Close the queue */
'IMFEXEC MQI DISC' /* Disconnect from queue manager */
EXIT
The following list describes the variable values that are used or set by this command:
-
Variable IMFHCONN contains the connection handle name.
-
Variable IMFMQCC and IMFCC contain the completion code.
-
Variable IMFMQRC and IMFRC contain the reason code.
-
Variable IMFHOBJ contains the object handle for the queue.
-
Variable IMFMQI_REASON contains the constant (character) reason code.
Comments
Log in or register to comment.