| Author | 
		  Message
		 | 
		
		  | Sridar | 
		  
		    
			  
				 Posted: Tue Sep 12, 2006 1:22 am    Post subject: [Solved]Use of AND and OR in IF | 
				     | 
			   
			 
		   | 
		
		
		   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 | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | wschutz | 
		  
		    
			  
				 Posted: Tue Sep 12, 2006 2:01 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    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 | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | Sridar | 
		  
		    
			  
				 Posted: Tue Sep 12, 2006 3:58 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   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 | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | jefflowrey | 
		  
		    
			  
				 Posted: Tue Sep 12, 2006 4:04 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   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 | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | Sridar | 
		  
		    
			  
				 Posted: Tue Sep 12, 2006 5:25 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   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 | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | jefflowrey | 
		  
		    
			  
				 Posted: Tue Sep 12, 2006 6:13 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   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 | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | msukup | 
		  
		    
			  
				 Posted: Tue Sep 12, 2006 12:53 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   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 | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | jbanoop | 
		  
		    
			  
				 Posted: Wed Sep 13, 2006 12:30 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   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 | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | kimbert | 
		  
		    
			  
				 Posted: Wed Sep 13, 2006 1:12 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Jedi Council
 
 Joined: 29 Jul 2003 Posts: 5543 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 | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | Sridar | 
		  
		    
			  
				 Posted: Wed Sep 13, 2006 1:48 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   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 | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | 
		    
		   |