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 » [Solved]Use of AND and OR in IF

Post new topic  Reply to topic
 [Solved]Use of AND and OR in IF « View previous topic :: View next topic » 
Author Message
Sridar
PostPosted: Tue Sep 12, 2006 1:22 am    Post subject: [Solved]Use of AND and OR in IF Reply with quote

Acolyte

Joined: 14 May 2006
Posts: 72
Location: Chennai, India

Hi

I am trying to use the following type of Condition but it is not working out for me.

IF ((CONDN_A) OR ((CONDN_B) AND (CONDN_C)))
STMTS..
ELSE IF ((CONDN_E) AND (CONDN_F))
STMTS..
END IF;
END IF;

It skips both cases even if one of them is true.

Is there any other way out other than using a Nested IF Else?
_________________
Thanks and Regards
Sridar


Last edited by Sridar on Wed Sep 13, 2006 1:53 am; edited 1 time in total
Back to top
View user's profile Send private message
wschutz
PostPosted: Tue Sep 12, 2006 2:01 am    Post subject: Reply with quote

Jedi Knight

Joined: 02 Jun 2005
Posts: 3316
Location: IBM (retired)

Have you used the debugger to verify that your conditions actually evaluate to TRUE?

Also, I would have coded ELSEIF ....

Lastly, a user trace would show intermediate results on the evaluations.....
_________________
-wayne
Back to top
View user's profile Send private message Send e-mail AIM Address
Sridar
PostPosted: Tue Sep 12, 2006 3:58 am    Post subject: Reply with quote

Acolyte

Joined: 14 May 2006
Posts: 72
Location: Chennai, India

The Problem is now resolved.

Actually the problem was with the way was accessing an attribute in the condition.

I had given Element.(XML.attr)Attribute.
When i removed the (XML.attr) it was working fine. i.e. Element.Attribute.

The IBM documents howewer say we need to use (XML.attr).
Can anyone advise?
_________________
Thanks and Regards
Sridar
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Sep 12, 2006 4:04 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

No, we can't advise. You haven't told us what you're actually trying to do in enough detail.

(XML.Attribute) is only a valid qualifier in one of the XML domains - XML, XMLNS, XMLNSC.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
Sridar
PostPosted: Tue Sep 12, 2006 5:25 am    Post subject: Reply with quote

Acolyte

Joined: 14 May 2006
Posts: 72
Location: Chennai, India

Hi

I am using an XML format message and an MRM parser.
The MB Version is 5.0.

I am trying to access the attribute aand compare its value and appropriately do the necessary mappings.
_________________
Thanks and Regards
Sridar
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Sep 12, 2006 6:13 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Is "an MRM Parser" one of the XML domains that I listed?
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
msukup
PostPosted: Tue Sep 12, 2006 12:53 pm    Post subject: Reply with quote

Acolyte

Joined: 11 Feb 2002
Posts: 56

Sridar,

If one of the values that you are evaluating is NULL, then it may not evaluate expression correctly . . . NULL is neither true nor false.

So this means that the "condition" is not evaluating correctly. What is the condition? How are you accessing the attribute?
Back to top
View user's profile Send private message MSN Messenger
jbanoop
PostPosted: Wed Sep 13, 2006 12:30 am    Post subject: Reply with quote

Chevalier

Joined: 17 Sep 2005
Posts: 401
Location: SC

try the debugger..i have a strong hunch it will solve your issue..
Anoop
Back to top
View user's profile Send private message Yahoo Messenger
kimbert
PostPosted: Wed Sep 13, 2006 1:12 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
I had given Element.(XML.attr)Attribute.
When i removed the (XML.attr) it was working fine. i.e. Element.Attribute.

The IBM documents howewer say we need to use (XML.attr).
Not quite true. The IBM documents say that in the topics which describe the XML, XMLNS and XMLNSC domains. ( look at Jeff's comments earlier in this thread ).
You cannot ( and do not need to ) use XML.attr when you are using the MRM parser. See this thread for the reason why: http://www.mqseries.net/phpBB2/viewtopic.php?t=31673&highlight=xml+mrm
Back to top
View user's profile Send private message
Sridar
PostPosted: Wed Sep 13, 2006 1:48 am    Post subject: Reply with quote

Acolyte

Joined: 14 May 2006
Posts: 72
Location: Chennai, India

Thanks Kimbert

That link provided some input.

Thanks All
_________________
Thanks and Regards
Sridar
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 » [Solved]Use of AND and OR in IF
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.