C example: Disconnecting from a queue manager
This example demonstrates how to use the MQDISC call to disconnect a program from a queue manager in z/OS® batch.
The variables used in this code extract are those that were set in C example: Connecting to a queue manager. This extract is taken from the Browse sample application (program CSQ4BCA1).
For the names and locations of the sample applications, see Using the sample procedural programs for z/OS.
⋮
/* */
/* Disconnect from the queue manager. Test the */
/* output of the disconnect call. If the call */
/* fails, print an error message showing the */
/* completion code and reason code. */
/* */
MQDISC(&Hconn,
&CompCode,
&Reason);
if ((CompCode != MQCC_OK) || (Reason != MQRC_NONE))
{
sprintf(pBuff, MESSAGE_4_E,
ERROR_IN_MQDISC, CompCode, Reason);
PrintLine(pBuff);
RetCode = CSQ4_ERROR;
}
⋮