I run the C program, which connect to MQ and try to get a message from it. I always get a message:
MQGET ended with reason code 2037
which means that MQ is not
MQRC 2037 is MQRC_NOT_OPEN_FOR_INPUT, you can find this information by running the mqrc command provided with the IBM MQ Client or server install, below is a sample output on a Linux server:
$ mqrc 2037
2037 0x000007f5 MQRC_NOT_OPEN_FOR_INPUT
You do not show the MQOPEN call but if it is using the O_options
, it would be explained by this, you currently have the following:
O_options = MQOO_OUTPUT + MQOO_FAIL_IF_QUIESCING;
This should someing like the following:
O_options = MQOO_INPUT_AS_Q_DEF + MQOO_FAIL_IF_QUIESCING;
I would suggested that you review the sample applications provided with the IBM MQ install. On Linux these would be located in /opt/mqm/samp
. The sample amqsget0.c
would be similar to your program except it is using a MQCONN not MQCONNX.