code ::
import pymqi
queue_manager = 'CSQ9'
qmgr = pymqi.connect(queue_manager)
From native z/OS you cannot use a client to connect, as there is no support to run a client on z/OS. You can still use the MQCONNX, but not use the client support.
It may be easier to create a connect method (function), so you define the connect parameters once, and call the function from your code. To change queue manager parameters, you change just one file.
code::
import pymqi
def connect():
queue_manager = 'CSQ9'
cd = pymqi.CD()
sco = pymqi.SCO()
qmgr = pymqi.QueueManager(None)
qmgr.connect_with_options(queue_manager, cd, sco)
return qmgr
code::
qmgr.disconnect()