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 » WebSphere Message Broker (ACE) Support » ESQL - statement Case

Post new topic  Reply to topic
 ESQL - statement Case « View previous topic :: View next topic » 
Author Message
fcotait
PostPosted: Fri Apr 25, 2003 7:01 am    Post subject: ESQL - statement Case Reply with quote

Acolyte

Joined: 28 Feb 2002
Posts: 63
Location: Sao Paulo - Brazil

Hi all,

I'm trying to use the statement Case as the CSD Release Guide documentation (http://publibfp.boulder.ibm.com/epubs/pdf/tipzay00.pdf), but I'm getting error BIP2401E: (32, 7) : Syntax error : expected 'END' but found 'keyword Case'.

The ESQL Code is:

CASE Environment.Variables.PartnerId
WHEN 59275792000150 THEN
SET Environment.Variables.Partner = 'PARTNER 1';
SET OutputLocalEnvironment.Destination.RouterList.DestinationData[1].labelname = 'LABEL1';
WHEN 59104273000129 THEN
SET Environment.Variables.Partner = 'PARTNER 2';
SET OutputLocalEnvironment.Destination.RouterList.DestinationData[1].labelname = 'LABEL2';
WHEN 43999424000114 THEN
SET Environment.Variables.Partner = 'PARTNER 3';
SET OutputLocalEnvironment.Destination.RouterList.DestinationData[1].labelname = 'LABEL3';
END CASE;

My WMQI version is 2.1 with CSD 04

Any Idea ?

Thanks
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
jefflowrey
PostPosted: Fri Apr 25, 2003 9:25 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Drop the 'CASE' after 'END'.

It's just
Code:
CASE Environment.Variables.PartnerId
WHEN 59275792000150 THEN
SET Environment.Variables.Partner = 'PARTNER 1';
SET OutputLocalEnvironment.Destination.RouterList.DestinationData[1].labelname = 'LABEL1';
WHEN 59104273000129 THEN
SET Environment.Variables.Partner = 'PARTNER 2';
SET OutputLocalEnvironment.Destination.RouterList.DestinationData[1].labelname = 'LABEL2';
WHEN 43999424000114 THEN
SET Environment.Variables.Partner = 'PARTNER 3';
SET OutputLocalEnvironment.Destination.RouterList.DestinationData[1].labelname = 'LABEL3';
END;
Back to top
View user's profile Send private message
fcotait
PostPosted: Fri Apr 25, 2003 9:35 am    Post subject: Reply with quote

Acolyte

Joined: 28 Feb 2002
Posts: 63
Location: Sao Paulo - Brazil

It doesn´t work. I got the same error

Any more idea ?

Thanks
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
jefflowrey
PostPosted: Fri Apr 25, 2003 11:11 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

That says it wasn't complaining about the 'CASE' in 'END CASE'. It's complaining about finding CASE inside something else that hasn't ended properly.

That is, some code before your CASE statement starts.
Back to top
View user's profile Send private message
yaakovd
PostPosted: Sun Apr 27, 2003 11:54 am    Post subject: Reply with quote

Partisan

Joined: 20 Jan 2003
Posts: 319
Location: Israel

I guess you problem becouse you have 2 expressions in searched-when-clause:

It should be:
Code:

WHEN
search-condition
THEN
result-expression

And yu have:
Code:
WHEN
search-condition
THEN
result-expression1
result-expression2


may be you can create some procedure for multiple expressions...
I think that in your case you need:
Code:

IF Environment.Variables.PartnerId = 59275792000150 THEN
SET Environment.Variables.Partner = 'PARTNER 1';
SET OutputLocalEnvironment.Destination.RouterList.DestinationData[1].labelname = 'LABEL1';
ELSE IF Environment.Variables.PartnerId  = 59104273000129 THEN
SET Environment.Variables.Partner = 'PARTNER 2';
SET OutputLocalEnvironment.Destination.RouterList.DestinationData[1].labelname = 'LABEL2';
ELSE IF Environment.Variables.PartnerId  = 43999424000114 THEN
SET Environment.Variables.Partner = 'PARTNER 3';
SET OutputLocalEnvironment.Destination.RouterList.DestinationData[1].labelname = 'LABEL3';
END IF;
END IF;
END IF;

_________________
Best regards.
Yaakov
SWG, IBM Commerce, Israel


Last edited by yaakovd on Sun Apr 27, 2003 12:01 pm; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail
Ian
PostPosted: Mon Apr 28, 2003 1:23 am    Post subject: Reply with quote

Disciple

Joined: 22 Nov 2002
Posts: 152
Location: London, UK

Hi All,

Websphere MQ Integrator V2.1 CSD03 README includes the following text :

Quote:

95. ESQL CASE Statements
The current version of ESQL Reference manual describes the new ESQL CASE statement functionality.
This functionality is not enabled in CSD3.


It is my understanding that :

-> WMQI Development team intended to implement a CASE statement in the WMQI v2.1 CSD03 level
-> This new functionality had been included in the documentation
-> This was withdrawn late after a regression was highlighted in regression testing
-> A note was added to the README to indicate this

-> WMQI Service team have subsequently taken an APAR (IC35769) to correct/enhance the docs/readme wrt to this

-> The CASE statement is not supported in WMQI v2.1 CSD03 (until a subsequent CSD or future release explicitly specifies otherwise)
-> The CASE function remains unchanged in WMQI v2.1 at all levels
_________________
Regards, Ian
Back to top
View user's profile Send private message
miron
PostPosted: Mon Apr 28, 2003 7:32 am    Post subject: exception in CASE Reply with quote

Apprentice

Joined: 27 Jun 2002
Posts: 39
Location: New York

Hello,

Is there a way to throw user exception in 'old' CASE ?

This example does not work:
set tempfld =
case InputRoot.XML.something.myfld
when 'a' then 'c'
when 'b' then 'd'
else
throw user exception values('incorrect input data');
end;

Is there any way to code something similar?

Thanks.
Back to top
View user's profile Send private message
fcotait
PostPosted: Mon Apr 28, 2003 7:52 am    Post subject: Reply with quote

Acolyte

Joined: 28 Feb 2002
Posts: 63
Location: Sao Paulo - Brazil

Yaakov,

Your solution worked.... Thanks

Ian,

I undestood the same thing about CSD readme, but I have CSD 4 installed but the Windows Register shows me CSD 5 (? as far as I know, CSD 4 is the latest one) do you know something about that ?

Miron,

I don´t think so, because the values in "OLD CASE" goes to a variable, the Yaakov´s solution will work for you.

Thanks all
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Ian
PostPosted: Tue Apr 29, 2003 2:18 am    Post subject: Reply with quote

Disciple

Joined: 22 Nov 2002
Posts: 152
Location: London, UK

Hi,

Quote:

-> The CASE statement is not supported in WMQI v2.1 CSD03 (until a subsequent CSD or future release explicitly specifies otherwise)


This implies that the CASE statement is not supported in WMQI v2.1 CSD03 and CSD04 (and any other future CSD at this release level) until there is another note to explicitly indicate that it is.


With respect to your other question :

-> The IBM Support website indicates that WMQI v2.1 CSD04 is the latest CSD (as of 29 April 2003) :

http://www-3.ibm.com/software/integration/support/summary/mqsi.html


-> It is my understanding that WMQI v2.1 GA would show the level (in the Windows registry) as being "0".

-> It is also my understanding that WMQI v2.1 included a GA PTF (ie a CSD 0) which would increment that level to "1".

-> This then follows that with WMQI v2.1 with CSD04 applied, the level will show as being "5"

Here is an extract from my WMQI v2.1 CSD04 README :

Code:

Change History:
2.1 GA            November  14th 2001
GA PTF            December  13th 2001
Web update        December  18th 2001
Web update        January    2nd 2002
CSD01             January   11th 2002
CSD02             March     28th 2002
Web update        April      4th 2002
Web update        April      8th 2002
CSD03             August    26th 2002
Web Update        August    28th 2002
Web Update        September  2nd 2002
Web Update        September 12th 2002
CSD04             November  22nd 2002

_________________
Regards, Ian
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » ESQL - statement Case
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.