C example: Closing a queue
This example demonstrates how to use the MQCLOSE call to close a queue.
This extract is taken from the Browse sample application.
For IBM® MQ for z/OS® this is program CSQ4BCA1.
For the names and locations of the sample applications, see the following topics:
⋮
/* */
/* Close the queue. */
/* Test the output of the close call. If the call */
/* fails, print an error message showing the */
/* completion code and reason code. */
/* */
MQCLOSE(Hconn,
&Hobj,
MQCO_NONE,
&CompCode,
&Reason);
if ((CompCode != MQCC_OK) || (Reason != MQRC_NONE))
{
sprintf(pBuff, MESSAGE_4_E,
ERROR_IN_MQCLOSE, CompCode, Reason);
PrintLine(pBuff);
RetCode = CSQ4_ERROR;
}
⋮
![[UNIX, Linux, Windows, IBM i]](../common/../develop/ngmulti.gif)
![[z/OS]](../common/../develop/ngzos.gif)