COBOL 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 COBOL example: Connecting to a queue manager.
This extract is taken from the Browse sample application.
For IBM® MQ for z/OS this is program CSQ4BVA1.
For the names and locations of the sample applications, see the following topics:
⋮
*
* Disconnect from the queue manager
*
CALL 'MQDISC' USING W03-HCONN
W03-COMPCODE
W03-REASON.
*
* Test the output of the disconnect call. If the
* call fails, print an error message showing the
* completion code and reason code.
*
IF (W03-COMPCODE NOT = MQCC-OK) THEN
⋮
END-IF.
⋮
![[UNIX, Linux, Windows, IBM i]](../common/../develop/ngmulti.gif)
![[z/OS]](../common/../develop/ngzos.gif)