ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum IndexGeneral IBM MQ Supportrunmqsc error handling

Post new topicReply to topic Goto page 1, 2  Next
runmqsc error handling View previous topic :: View next topic
Author Message
sudaltsov
PostPosted: Fri Mar 09, 2018 3:23 am Post subject: runmqsc error handling Reply with quote

Acolyte

Joined: 02 May 2012
Posts: 64

Does anybody have any idea how to check runmqsc success/failure in the client mode? I am talking about checking $? after exit. It seems it works correctly when in local mode and always 0 in client mode:
Code:
> runmqsc MYQM < zz
5724-H72 (C) Copyright IBM Corp. 1994, 2015.
Starting MQSC for queue manager MYQM.


     1 : DEFINE QL ('EXISTINGREMOTEQ') REPLACE
AMQ8151: WebSphere MQ object has different type.
One MQSC command read.
No commands have a syntax error.
One valid MQSC command could not be processed.
> echo $?
10
>  runmqsc -c MYQM < zz
5724-H72 (C) Copyright IBM Corp. 1994, 2015.
Starting MQSC for queue manager MYQM.


     1 : DEFINE QL ('EXISTINGREMOTEQ') REPLACE
AMQ8151: WebSphere MQ object has different type.
1 command responses received.

> echo $?
0
It looks like a clear bug to me.
Back to top
View user's profile Send private message
sudaltsov
PostPosted: Fri Mar 09, 2018 3:26 am Post subject: Reply with quote

Acolyte

Joined: 02 May 2012
Posts: 64

Just in case:
Code:
> dspmqver
Name:        WebSphere MQ
Version:     8.0.0.5
Level:       p800-005-160516.2
BuildType:   IKAP - (Production)
Platform:    WebSphere MQ for AIX
Mode:        64-bit
O/S:         AIX 7.1
InstName:    Installation4
InstDesc:
Primary:     Yes
InstPath:    /opt/IBM/WMQ/8.0.0.5/usr/mqm
DataPath:    /var/mqm
MaxCmdLevel: 802
LicenseType: Production

Can anyone please check that on the newer versions?
Back to top
View user's profile Send private message
PaulClarke
PostPosted: Fri Mar 09, 2018 3:51 am Post subject: Reply with quote

Guardian

Joined: 17 Nov 2005
Posts: 902
Location: New Zealand

Trying to parse the responses to RUNMQSC is always going to be a bit tricky. Have a look at MQSCX. This makes it easy to check the success/failure of each command as well as much more.

Cheers,
Paul.
_________________
Paul Clarke
MQGem Software
www.mqgem.com
Back to top
View user's profile Send private message Visit poster's website
sudaltsov
PostPosted: Fri Mar 09, 2018 7:35 am Post subject: Reply with quote

Acolyte

Joined: 02 May 2012
Posts: 64

Unfortunately that tool is commercial, and pricy one. I do not think that would be approved by the company.
Back to top
View user's profile Send private message
PaulClarke
PostPosted: Fri Mar 09, 2018 10:23 am Post subject: Reply with quote

Guardian

Joined: 17 Nov 2005
Posts: 902
Location: New Zealand

Hi,

Sorry, I should have made it more obvious that I was talking about our own product there with <Vendor> tags or something.

That is probably the first time I have heard MQSCX being referred to as 'pricey' though. An individual yearly MQSCX licence is NZ$ 100 (or about USD 73). That is about 20 cents a day! If you have many users then the licence cost per user can be significantly less.

So the question one should ask is "how much time would MQSCX need to save me in my daily work day to pay for itself'. At 20 cents a day I suspect it is not very much time at all - unless you are really, really under paid The average US Salary is $44,564 a year or $21.42 an hour. So, to pay for itself MQSCX would need to save you only 34 seconds a day. And that is average salary - I suspect most MQ Administrators are paid considerably more than average salary.

I agree that getting management to sign off on any tools purchase can be a challenge. They never seem to quite grasp the concept of visible versus invisible cost. However, I don't agree with you that MQSCX is expensive and I think it is fairly easy to make a case that it would actually save your company money. This is true, of course, of many products, not just MQSCX.

Cheers,

Paul.
_________________
Paul Clarke
MQGem Software
www.mqgem.com
Back to top
View user's profile Send private message Visit poster's website
sudaltsov
PostPosted: Mon Mar 12, 2018 1:56 am Post subject: Reply with quote

Acolyte

Joined: 02 May 2012
Posts: 64

I see your point and I agree that your tool is a good value for money (providing it actually delivers what is said on the website). But you correctly mentioned that tools like these are difficult to get through the management. And yes I totally agree that runmqsc is a usability disaster which is crying for replacement with something usable. Anyway, I will make an effort to get your tool into our company, but I am not holding my breath...

Anyway, my question still remains unanswered within runmqsc-bound sphere of solutions...
Back to top
View user's profile Send private message
crashdog
PostPosted: Mon Mar 12, 2018 2:50 am Post subject: Reply with quote

Novice

Joined: 02 Apr 2017
Posts: 24
Location: Schaffhausen

Only three exit return codes are defined by IBM:
Return code

Description

00 MQSC command file processed successfully
10 MQSC command file processed with errors; report contains reasons for failing commands
20 Error; MQSC command file not run

https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_8.0.0/com.ibm.mq.ref.adm.doc/q083460_.htm

You have a productive version of MQ. So if you think it's a bug always open a PMR.

In general there is no concept hammered in stone when it comes to return codes in Unix. Some efforts have been made to try to standardize it though:
http://tldp.org/LDP/abs/html/exitcodes.html

Cheers,
Gerhard
_________________
You win again gravity !
Back to top
View user's profile Send private message
sudaltsov
PostPosted: Mon Mar 12, 2018 5:34 am Post subject: Reply with quote

Acolyte

Joined: 02 May 2012
Posts: 64

Yes, I would expect code 10 when there are errors. And with local QM runmqsc gives exactly that. But not in the client mode...
Back to top
View user's profile Send private message
bruce2359
PostPosted: Mon Mar 12, 2018 7:41 am Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 8128
Location: US: west coast, almost. Otherwise, enroute.

Are you running runmqsc in the same shell? On a platform with both qmgr (server) and MQ Client?

Post the env settings for MQSERVER, MQCHLLIB and MQCHLTAB when you runmqsc with -c switch.
_________________
I would tell you a UDP joke, but you might not get it.
Back to top
View user's profile Send private message
sudaltsov
PostPosted: Mon Mar 12, 2018 7:54 am Post subject: Reply with quote

Acolyte

Joined: 02 May 2012
Posts: 64

Yes I am running on the same server, same shell, same QM.
MQCHLLIB and MQCHLTAB are not defined.
MQSERVER points to the some valid channel on that QM (sorry won't give the hostname here, do not want troubles).
I am sure MQSERVER is correct because valid mqsc commands are executed without problems.

The scenario is perfectly reproducible.
Back to top
View user's profile Send private message
bruce2359
PostPosted: Mon Mar 12, 2018 8:43 am Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 8128
Location: US: west coast, almost. Otherwise, enroute.

Is there another qmgr with the same name in your network? One in PROD, another in TEST?

I just noticed the different type error. Does the MQSERVER IP and PORT point to a different qmgr?
_________________
I would tell you a UDP joke, but you might not get it.


Last edited by bruce2359 on Mon Mar 12, 2018 9:10 am; edited 1 time in total
Back to top
View user's profile Send private message
sudaltsov
PostPosted: Mon Mar 12, 2018 8:47 am Post subject: Reply with quote

Acolyte

Joined: 02 May 2012
Posts: 64

I intentionally created 'bad' mqsc. Totally expected 'different type' error means I am trying to create local queue with the same name as the existing remote queue. I want that script to fail - so I am demonstrating that local runmqsc gives proper error code 10 while client-mode runmqsc returns (incorrectly) 0.

PS No, there is only one QM with that name.
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Mar 12, 2018 9:06 am Post subject: Re: runmqsc error handling Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 25170
Location: Ohio, USA

sudaltsov wrote:
It looks like a clear bug to me.


Then you need a PMR - no one in this forum will be able to fix it.

I do agree that it looks a lot like the client version is reporting that it's successfully passed the command to the target queue manager rather than the result of the command; this is in line with the InfoCenter entry on runmqsc if not the spirit of it. So a PMR is needed to either fix runmqsc or (as I perhaps cynically expect) the InfoCenter to be reworded......

I would also agree with @PaulClark that if you're trying to automate a lot of administration then you need a commercial product (possibly his - it does do what it says on the website and suggesting otherwise is a bit off). Obviously having such a product adopted requires some effort but if your management compares the Total Cost of Ownership of such a product with having you (or your successors) maintain a series of scripts then the numbers are usually clear.

(I have no connection to @PaulClark except he's a nice man who buys me drinks at MQTC, I receive no commission from his sales, other commercial products are available which may fit your requirements better and no liability, express or implied, is accepted for any consequences of any decision you may make)



_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
bruce2359
PostPosted: Mon Mar 12, 2018 9:14 am Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 8128
Location: US: west coast, almost. Otherwise, enroute.

... and your mileage may vary.
_________________
I would tell you a UDP joke, but you might not get it.
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Mar 12, 2018 9:17 am Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 25170
Location: Ohio, USA

bruce2359 wrote:
... and your mileage may vary.


Quite so!
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Display posts from previous:
Post new topicReply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum IndexGeneral IBM MQ Supportrunmqsc error handling
Jump to:



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP


Theme by Dustin Baccetti
Powered by phpBB 2001, 2002 phpBB Group

Copyright MQSeries.net. All rights reserved.