Use MQSERVER
If we use the MQSERVER environment variable to define the channel between the IBM MQ MQI client machine and a server machine, this is the only channel available to the application, and no reference is made to the client channel definition table (CCDT).
In this situation, the listener program that we have running on the server machine determines the queue manager to which the application will connect. It will be the same queue manager as the listener program is connected to.
If the MQCONN or MQCONNX request specifies a queue manager other than the one the listener is connected to, or if the MQSERVER parameter TransportType is not recognized, the MQCONN or MQCONNX request fails with return code MQRC_Q_MGR_NAME_ERROR.
On UNIX and Linux systems, you might define MQSERVER as in one of the following examples:export MQSERVER=CHANNEL1/TCP/'9.20.4.56(2002)' export MQSERVER=CHANNEL1/LU62/BOX99
All MQCONN or MQCONNX requests then attempt to use the channel you have defined unless an MQCD structure has been referenced from the MQCNO structure supplied to MQCONNX, in which case the channel specified by the MQCD structure takes priority over any specified by the MQSERVER environment variable.
The MQSERVER environment variable takes priority over any client channel definition pointed to by MQCHLLIB and MQCHLTAB.
Canceling MQSERVER
To cancel MQSERVER and return to the client channel definition table pointed to by MQCHLLIB and MQCHLTAB, enter the following:- On Windows:
SET MQSERVER=
- On UNIX and Linux:
unset MQSERVER
Parent topic: MQSERVER