Can't work with queue manager on z/OS

Asked by RockBomber

Hi
I work on x64-bit Linux system with MQ Websphere 7.5 and PyMQI 1.2 patched with https://launchpadlibrarian.net/118395690/pymqi-1.2-75support.patch
When I trying to connect and ping queue manager (or other actions like define new queue or channel) that deployed on Linux system - all ok
But when I trying to make similar action with queue manager that deployed on z/OS system and with queue-sharing groups - I get exception:

Traceback (most recent call last):
  File "mq.py", line 13, in <module>
    pcf.MQCMD_PING_Q_MGR()
  File "/usr/local/lib/python2.7/dist-packages/pymqi.py", line 2086, in __call__
    raise MQMIError(rv[-2], rv[-1])
pymqi.MQMIError: MQI Error. Comp: 1, Reason 2068: WARNING: MQRC_SELECTOR_NOT_FOR_TYPE

My code:

import pymqi

queue_manager = "manager"
channel = "SYSTEM.ADMIN.SVRCONN"
host = "192.168.2.2"
port = "1414"

conn_info = "%s(%s)" % (host, port)

qmgr = pymqi.connect(queue_manager, channel, conn_info)
pcf = pymqi.PCFExecute(qmgr)

pcf.MQCMD_PING_Q_MGR()

qmgr.disconnect()

What I doing wrong?

Question information

Language:
English Edit question
Status:
Answered
For:
PyMQI Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Dariusz Suchojad (dsuch) said :
#1

> But when I trying to make similar action with queue manager that deployed on z/OS system and with queue-sharing groups - I get exception:
>
> Traceback (most recent call last):
> File "mq.py", line 13, in <module>
> pcf.MQCMD_PING_Q_MGR()
> File "/usr/local/lib/python2.7/dist-packages/pymqi.py", line 2086, in __call__
> raise MQMIError(rv[-2], rv[-1])
> pymqi.MQMIError: MQI Error. Comp: 1, Reason 2068: WARNING: MQRC_SELECTOR_NOT_FOR_TYPE

> pcf.MQCMD_PING_Q_MGR()

Hi there,

I don't have access to z/OS but I'm wondering if it's now because
PING_Q_MGR isn't supported on MF?

http://pic.dhe.ibm.com/infocenter/wmqv7/v7r5/topic/com.ibm.mq.doc/pc13630_.htm

Are you sure the commands that fail are not of that lot?

Revision history for this message
RockBomber (rockbomber) said :
#2

Thank you for answer!

Yes, PING_Q_MGR isn't support on z/OS
But other command (CREATE_CHANNEL, CREATE_Q, START_CHANNEL, STOP_CHANNEL, etc.) also raise exception MQRC_SELECTOR_NOT_FOR_TYPE

But I now observed that MQ version on the z/OS system is 7.1, while on the Linux - 7.5
PyMQI supports now only command levels 7.0 and 7.5
I think it's reason of exception)

Revision history for this message
Dariusz Suchojad (dsuch) said :
#3

> But I now observed that MQ version on the z/OS system is 7.1, while on the Linux - 7.5
> PyMQI supports now only command levels 7.0 and 7.5
> I think it's reason of exception)

I'm really sorry to hear!

Did you perhaps have a chance to have a look at this blog post of mine?
Can your company do anything about it? This could possibly help in your
case.

http://www.gefira.pl/blog/2013/02/07/can-you-sponsor-pymqi-1-3-python-and-websphere-mq-interface/

Revision history for this message
RockBomber (rockbomber) said :
#4

Unfortunately, I have not a company. I'm student writing tool for my routine job of tech support. I just want to have one-click gui for some tasks.
But I can donate few dollars :)
I tryed to adapt 7.5 support patch for version 7.1, but I get same error.

Revision history for this message
Dariusz Suchojad (dsuch) said :
#5

> I tryed to adapt 7.5 support patch for version 7.1, but I get same error.

Thanks for the offer but you know, I've just given it a second thought
and I'm wondering if it is really to do with there not being a proper
support for 7.1/7.5

Can you please post the very exact PyMQI program that doesn't work on
z/OS but does work on Linux along with an MQSC script needed to create
the objects?

Revision history for this message
RockBomber (rockbomber) said :
#6

My script is here: http://pastebin.com/TDSexMMj

Revision history for this message
Dariusz Suchojad (dsuch) said :
#7

> My script is here: http://pastebin.com/TDSexMMj

OK, cool, so here are two other things:

- I understand you're connecting from a Linux box to z/OS. Can you make
sure MQ version on both is the same? This would mean installing 7.1 on
Linux and recompiling PyMQI.

- Are you all of the attributes you use set for MQ object in your
program are actually supported on z/OS, MQ 7.1? Isn't anything new in
7.5 or not supported on z/OS?

Revision history for this message
RockBomber (rockbomber) said :
#8

Yes, I connecting from Linux box.
I tried install versions 7.0, 7.1 and 7.5. And recompiled PyMQI for every version of MQ.
But every time I got exception MQRC_SELECTOR_NOT_FOR_TYPE, when I send any command to z/OS MQ.

I tried to set only required attributes (for example: MQCA_Q_NAME and MQIA_Q_TYPE for creating new queue). But I got exception again.
I got exception when even I send simple commands: MQCMD_STOP_CHANNEL and MQCMD_START_CHANNEL

But when I connection to Linux MQ, all works fine)

Revision history for this message
Dariusz Suchojad (dsuch) said :
#9

On 02/12/2013 03:11 PM, RockBomber wrote:

> I tried to set only required attributes (for example: MQCA_Q_NAME and MQIA_Q_TYPE for creating new queue). But I got exception again.

OK, but is it the very same MQRC_SELECTOR_NOT_FOR_TYPE exception?
Because the more I read about it the less I understand if for each
command you see the same error.

Can you please post the exact output of running this program? The exact
traceback?

http://pythonhosted.org/pymqi/examples.html#how-to-define-a-queue

--
Dariusz Suchojad

Revision history for this message
RockBomber (rockbomber) said :
#10

Yes, for each command I get same MQRC_SELECTOR_NOT_FOR_TYPE exception

For example:

# test_mq.py

import pymqi
import CMQC

queue_manager = "LDT3"
channel = "SYSTEM.ADMIN.SVRCONN"
host = "13.99.120.170"
port = "1511"
conn_info = "%s(%s)" % (host, port)

queue_name = "MYQUEUE.1"
queue_type = CMQC.MQQT_LOCAL
max_depth = 123456

args = {CMQC.MQCA_Q_NAME: queue_name,
        CMQC.MQIA_Q_TYPE: queue_type,
        CMQC.MQIA_MAX_Q_DEPTH: max_depth}

qmgr = pymqi.connect(queue_manager, channel, conn_info)

pcf = pymqi.PCFExecute(qmgr)
pcf.MQCMD_CREATE_Q(args)

qmgr.disconnect()

> python test_mq.py
Traceback (most recent call last):
  File "test_mq.py", line 21, in <module>
    pcf.MQCMD_CREATE_Q(args)
  File "/usr/local/lib/python2.7/dist-packages/pymqi.py", line 2076, in __call__
    raise MQMIError(rv[-2], rv[-1])
pymqi.MQMIError: MQI Error. Comp: 1, Reason 2068: WARNING: MQRC_SELECTOR_NOT_FOR_TYPE

Revision history for this message
Dariusz Suchojad (dsuch) said :
#11

> Yes, for each command I get same MQRC_SELECTOR_NOT_FOR_TYPE exception

Hmm... I think I have a bad news for you.

See, PyMQI uses MAQI to implement PCF commands. MQAI is a wrapper for
PCF which really simplifies MQ programmer's life. The trouble is, the
documentation explicitly says MQAI is not supported on z/OS

http://pic.dhe.ibm.com/infocenter/wmqv7/v7r5/topic/com.ibm.mq.doc/pc15450_.htm

"""
The MQAI is a programming interface to WebSphere® MQ, using the C
language and also Visual Basic for Windows®. It is available on
platforms other than z/OS®.
"""

So I'm afraid MF is showing its age here.

Really sorry for all the commotion but I just don't have access to z/OS.
Otherwise I would've tested it myself earlier to save you all the troubles.

Revision history for this message
RockBomber (rockbomber) said :
#12

Thank You for answer!
Then I will search other way for my tasks :)

Revision history for this message
Dariusz Suchojad (dsuch) said :
#13

I've just released PyMQI 1.3 and the development effort has moved to GitHub - https://github.com/dsuch/pymqi

Can you help with this problem?

Provide an answer of your own, or ask RockBomber for more information if necessary.

To post a message you must log in.