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 Index » General Discussion » Inconsistency in command syntax scanning between platforms

Post new topic  Reply to topic Goto page 1, 2  Next
 Inconsistency in command syntax scanning between platforms « View previous topic :: View next topic » 
Author Message
tleichen
PostPosted: Fri Feb 05, 2010 9:53 am    Post subject: Inconsistency in command syntax scanning between platforms Reply with quote

Yatiri

Joined: 11 Apr 2005
Posts: 663
Location: Center of the USA

Why is there such inconsistency in what is allowed for the ordering of keywords among the different platforms? For example, on z/OS, on version 6 of MQ, I can do the following:

DEFINE QL(Q1) DEFPSIST(YES) MAXMSGL(100) MAXDEPTH(1000)

DEFINE REPLACE LIKE(Q1) QL(Q2)

Using MQSeries v6.0.2.6 on AIX, HP, and maybe most other distributed platforms, the second statement gets a syntax error.

I would have hoped by now, such things would have been standardized.
_________________
IBM Certified MQSeries Specialist
IBM Certified MQSeries Developer
Back to top
View user's profile Send private message
Vitor
PostPosted: Fri Feb 05, 2010 10:12 am    Post subject: Re: Inconsistency in command syntax scanning between platfor Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

tleichen wrote:
I would have hoped by now, such things would have been standardized.


We can only hope the next version of the software fixes the syntax checker on z/OS so it too rejects the 2nd statement.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
bruce2359
PostPosted: Fri Feb 05, 2010 10:39 am    Post subject: Reply with quote

Poobah

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

The WMQ MQSC manual syntax specifies
>>---DEFINE QLOCAL---(q-name)--- ... which means that the queue name must immediately follow the DEFINE QLOCAL.

Syntax is the language specification written in the official documentation. History has demonstrated that results may vary by vendor, platform, software version, release, modification level.

This is consistent inconsistent behavior of many compilers and utilities.
_________________
I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live.
Back to top
View user's profile Send private message
tleichen
PostPosted: Fri Feb 05, 2010 11:25 am    Post subject: Reply with quote

Yatiri

Joined: 11 Apr 2005
Posts: 663
Location: Center of the USA

bruce2359 wrote:
The WMQ MQSC manual syntax specifies
Syntax is the language specification written in the official documentation. History has demonstrated that results may vary by vendor, platform, software version, release, modification level.

This is consistent inconsistent behavior of many compilers and utilities.

But MQ is still only an IBM product, regardless of the platform. I can understand various vendors having ambiguities regarding syntax between themselves. But this is just the right hand not talking to the left hand.
_________________
IBM Certified MQSeries Specialist
IBM Certified MQSeries Developer
Back to top
View user's profile Send private message
tleichen
PostPosted: Fri Feb 05, 2010 11:27 am    Post subject: Reply with quote

Yatiri

Joined: 11 Apr 2005
Posts: 663
Location: Center of the USA

Vitor wrote:
tleichen wrote:
I would have hoped by now, such things would have been standardized.


We can only hope the next version of the software fixes the syntax checker on z/OS so it too rejects the 2nd statement.
cute.
_________________
IBM Certified MQSeries Specialist
IBM Certified MQSeries Developer
Back to top
View user's profile Send private message
mqjeff
PostPosted: Fri Feb 05, 2010 11:32 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

In fact, this is specifically documented as allowable on zOS only.

Each command starts with a primary parameter (a verb), and this is followed by a secondary parameter (a noun). This is then followed by the name or generic name of the object (in parentheses) if there is one, which there is on most commands. Following that, parameters can usually occur in any order; if a parameter has a corresponding value, the value must occur directly after the parameter to which it relates.
Note: On z/OS, the secondary parameter does not have to be second.


And the same comment exists in v7
Back to top
View user's profile Send private message
mqjeff
PostPosted: Fri Feb 05, 2010 11:34 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Also, please don't get me started on the intricacies of parsing MQSC. It brings back painful memories of writing the parser in MS0S.
Back to top
View user's profile Send private message
bruce2359
PostPosted: Fri Feb 05, 2010 12:42 pm    Post subject: Reply with quote

Poobah

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

I used to keep a rubber mallet on my desk to smack programmers who wrote code that did not conform to the documented syntax. Following a software upgrade (or platform change), they would protest "This used to work!"

Parser software often lags the written syntax design.
_________________
I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Fri Feb 05, 2010 12:58 pm    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

bruce2359 wrote:
I used to keep a rubber mallet on my desk to smack programmers who wrote code that did not conform to the documented syntax.


While I fully support the appropriate use of programmer incentive devices, piscine or not, I reiterate that this DOES conform to the documented syntax.

MQSC is one of the single most flexible syntax structures I have ever seen.
It is fully legal to write MQSC that consists of no more two character per line, with an unlimited number of blank lines between each set of two characters.
D+


E+



F-



+




Q+











L+
....

Yes, I did have to use that - instead of a +.
Back to top
View user's profile Send private message
bruce2359
PostPosted: Fri Feb 05, 2010 1:07 pm    Post subject: Reply with quote

Poobah

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

Yep, it's flexible, but idiosyncratic - because it's software which seems to differ in its implementation on the differing platforms.

DEFINE REPLACE LIKE(Q1) QL(Q2) is the OPs lament. Mainframe MQ and midrange MQ seem to parse a bit differently as far back as 5.1.

I've worked on most platforms. It's been my experience that sticking to the written monorail syntax notation worked/works on all platforms.
_________________
I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Fri Feb 05, 2010 7:04 pm    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

bruce2359 wrote:
Yep, it's flexible, but idiosyncratic - because it's software which seems to differ in its implementation on the differing platforms.

DEFINE REPLACE LIKE(Q1) QL(Q2) is the OPs lament. Mainframe MQ and midrange MQ seem to parse a bit differently as far back as 5.1.


Sure. But you also said that doing DEFINE REPLACE was not legal syntax, when it explicitly is allowed on zOS.

So, yes, it's idiosyncratic. And yes, it's better not to use it.

But it's still not illegal.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Sat Feb 06, 2010 11:19 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

mqjeff wrote:
bruce2359 wrote:
Yep, it's flexible, but idiosyncratic - because it's software which seems to differ in its implementation on the differing platforms.

DEFINE REPLACE LIKE(Q1) QL(Q2) is the OPs lament. Mainframe MQ and midrange MQ seem to parse a bit differently as far back as 5.1.


Sure. But you also said that doing DEFINE REPLACE was not legal syntax, when it explicitly is allowed on zOS.

So, yes, it's idiosyncratic. And yes, it's better not to use it.

But it's still not illegal.


Regardless of where you put the REPLACE shouldn't the like follow the ql?
So I see only 2, maybe 3 legal statements here:

Code:
DEFINE QL(Q2) LIKE (Q1) REPLACE

and according to the legal define replace syntax on zOS
Code:
DEFINE REPLACE QL(Q2) LIKE (Q1)

Now you could argue for the next form here to be legal as well (args in indifferent order)
Code:
DEFINE QL(Q2) REPLACE LIKE(Q1)


Note that none of them corresponds to the one you used.
May be the syntax you used was indeed taking advantage of a loophole that has since been closed...

Note that ql(q2) is IMHO not an argument to the command as the command would be define ql(x)

Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Michael Dag
PostPosted: Sun Feb 07, 2010 3:26 am    Post subject: Reply with quote

Jedi Knight

Joined: 13 Jun 2002
Posts: 2607
Location: The Netherlands (Amsterdam)

Legal or not ... I would not like to inherit those scripts... I would have to put my brain in a twist all the time trying to read them...
_________________
Michael



MQSystems Facebook page
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
mqjeff
PostPosted: Sun Feb 07, 2010 6:04 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

fjb_saper wrote:
Regardless of where you put the REPLACE shouldn't the like follow the ql?


No.

The statement specifically says that the QL() parameter "does not have to be second".

This specifically means it can be *anywhere*, including *last*. Just as there's no requirement that LIKE be third, nor REPLACE last, nor TRIGTYPE before MAXMSGLN.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Sun Feb 07, 2010 12:59 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

mqjeff wrote:
fjb_saper wrote:
Regardless of where you put the REPLACE shouldn't the like follow the ql?


No.

The statement specifically says that the QL() parameter "does not have to be second".

This specifically means it can be *anywhere*, including *last*. Just as there's no requirement that LIKE be third, nor REPLACE last, nor TRIGTYPE before MAXMSGLN.


I follow you... so far...
So you can use define ql(q2) or define replace ql(q2). All other attributes of the command may come in any order. As specified ql(q2) does not need to be second (see define replace) but it does not say that you are free to put it anywhere...

Quote:
Each command starts with a primary parameter (a verb), and this is followed by a secondary parameter (a noun). This is then followed by the name or generic name of the object (in parentheses) if there is one, which there is on most commands. Following that, parameters can usually occur in any order; if a parameter has a corresponding value, the value must occur directly after the parameter to which it relates.
Note: On z/OS, the secondary parameter does not have to be second.


May be I am misunderstanding this http://publib.boulder.ibm.com/infocenter/wmqv6/v6r0/topic/com.ibm.mq.csqzaj.doc/sc10280_.htm

and this http://publib.boulder.ibm.com/infocenter/wmqv6/v6r0/topic/com.ibm.mq.csqzaj.doc/sc11210_.htm


_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum Index » General Discussion » Inconsistency in command syntax scanning between platforms
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.