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 » WBI migration question on EVAL statement

Post new topic  Reply to topic
 WBI migration question on EVAL statement « View previous topic :: View next topic » 
Author Message
schroederms
PostPosted: Thu Jan 20, 2005 1:57 pm    Post subject: WBI migration question on EVAL statement Reply with quote

Disciple

Joined: 21 Jul 2003
Posts: 169
Location: IA

Did something change in the EVAL from 2.1 to version 5 ?

We have some code a IBM consultant wrote for us in version 2.1 and has a syntax error now that looks OK to me based on what I've read on EVAL on the HELP of version 5. His code was buried in a ton of other code, so I pulled it out and put it into a Testing compute node to see if I can recreate it there, and I can.
No matter what statement I type that is now in red, is an error, so it looks like it maybe the previous EVAL statement. I could code DECLARE ABC CHARACTER; and it errors out. Code below.

Thanks.

CREATE COMPUTE MODULE Testing_Compute
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
-- Error number extracted from exception list
DECLARE Error CHARACTER;
-- Error Text extracted from the exceptionlist
DECLARE ErrorText CHARACTER;
-- Current path within the exception list
DECLARE Path CHARACTER;
-- Start at first child of exception list
SET Path = 'InputExceptionList.*[1]';
-- Loop until no more children for the Error number
WHILE EVAL( 'FIELDNAME(' || Path || ') IS NOT NULL' ) DO
-- Check if error number is available
IF EVAL( 'FIELDNAME(' || Path || '.Number) IS NOT NULL' ) THEN
-- Remember only the deepest error number
SET Error = EVAL( Path ||'.Number');
END IF;
SET Path = Path || '.*[<]';
END WHILE; -- End loop
RETURN TRUE;
END;

END MODULE;
Back to top
View user's profile Send private message
JT
PostPosted: Thu Jan 20, 2005 2:30 pm    Post subject: Reply with quote

Padawan

Joined: 27 Mar 2003
Posts: 1564
Location: Hartford, CT.

Quote:
....and has a syntax error now....

What is the exact text of the synatx error?
Back to top
View user's profile Send private message
JT
PostPosted: Thu Jan 20, 2005 2:51 pm    Post subject: Reply with quote

Padawan

Joined: 27 Mar 2003
Posts: 1564
Location: Hartford, CT.

The only major difference between the code your IBM consultant provided, and the example in the ESQL Reference manual (pg. 159) is the declaration of the Error variable. The example in the v2.1 & v5.0 manuals declare the variable as an INTEGER, not CHARACTER.

Was this changed at some point?
Back to top
View user's profile Send private message
schroederms
PostPosted: Thu Jan 20, 2005 2:52 pm    Post subject: Reply with quote

Disciple

Joined: 21 Jul 2003
Posts: 169
Location: IA

All it says within the ToolKit in the task list is:

"Syntax error." line 21


Not much to go off of.
Back to top
View user's profile Send private message
JT
PostPosted: Thu Jan 20, 2005 2:56 pm    Post subject: Reply with quote

Padawan

Joined: 27 Mar 2003
Posts: 1564
Location: Hartford, CT.

Then, see if adding a space after the logical operator helps:

Code:
SET Error = EVAL( Path || '.Number');
Back to top
View user's profile Send private message
schroederms
PostPosted: Thu Jan 20, 2005 2:57 pm    Post subject: Reply with quote

Disciple

Joined: 21 Jul 2003
Posts: 169
Location: IA

The only major difference between the code your IBM consultant provided, and the example in the ESQL Reference manual (pg. 159) is the declaration of the Error variable. The example in the v2.1 & v5.0 manuals declare the variable as an INTEGER, not CHARACTER.

Was this changed at some point?


No, I just mnigrated it today. I've printed off both v2.1 and v5 and they are the exact same with the exception of me changing:
SET Path = Path || '.*[LAST]' to
SET Path = Path || '.*[<] based on the compiler message stating the 'LAST' has been deprecated.
Back to top
View user's profile Send private message
schroederms
PostPosted: Thu Jan 20, 2005 3:00 pm    Post subject: Reply with quote

Disciple

Joined: 21 Jul 2003
Posts: 169
Location: IA

Then, see if adding a space after the logical operator helps:

Nope tried that too earlier today. What is weird you can replace that statment with:

DECLARE WHATTHECRAP CHARACTER;

and it too will error out. It's almost like the statement:
IF EVAL( 'FIELDNAME(' || Path || '.Number) IS NOT NULL' ) THEN

is causing it.
Back to top
View user's profile Send private message
JT
PostPosted: Fri Jan 21, 2005 6:45 pm    Post subject: Reply with quote

Padawan

Joined: 27 Mar 2003
Posts: 1564
Location: Hartford, CT.

Did you try declaring the Error variable as an Integer, as shown in the samples provided by IBM?

The Number element in the ExceptionList tree that you're attempting to extract, is defined as an Integer. See the following link:
http://publib.boulder.ibm.com/infocenter/wbihelp/topic/com.ibm.etools.mft.doc/ac00540_.htm
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 » WBI migration question on EVAL statement
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.