|   | 
	 
  
    | 
RSS Feed - WebSphere MQ Support
 | 
RSS Feed - Message Broker Support
 |   
 
  
	     | 
	 | 
   
 
  
	|  EVAL Function | 
	« View previous topic :: View next topic »  | 
   
  
  	
	  
		
		
		  | Author | 
		  Message
		 |  
		
		  | kishankumar.v | 
		  
		    
			  
				 Posted: Wed Jan 23, 2002 12:09 am    Post subject:  | 
				     | 
			   
			 
		   | 
		 
		
		   Apprentice
 
 Joined: 26 Nov 2001 Posts: 47
  
  | 
		  
		    
			  
				Hi,
 
1.
 
EVAL('SET OutputRoot.XML.'||OutputDestinationList.ColumnMap[1].CMSNAME||' =  InputRoot.XML.sname;');
 
Gives "Expected comment or processing instruction"  XML Parser error. Could not comprehend what it is.
 
 
2.
 
WHILE J <= 3 DO
 
EVAL('SET OutputRoot.XML.' || OutputDestinationList.columnMap[J].CMSNAME || ' =	InputBody.' ||OutputDestinationList.columnMap[J].SBLNAME||';');
 
END WHILE
 
This is not giving any output. But Iam sure OutputDestinationList contains values which I printed in a trace file.
 
 
3. 
 
How to do a trace while inside the compute node....say I want to store the temporary variables in the compute node in a file.
 
 
4. 
 
I want to have the output of eval function to be assigned to a path...say
 
SET OutputRoot.XML.check1 = EVAL('SET OutputRoot.XML.'||variable||' = InputBody.sname;');
 
This gives out a error..what I want to check is whether the concatenation is proper or not...I need somethig like
 
SET OutputRoot.XML.check1 = 'SET OutputRoot.XML.secondname = InputBody.sname;';
 
How it is possible using eval funtion.
 
 
Rather a set of doubts..But all are linked to the EVAL function.
 
Please let me know the solutions.
 
 
Regards,
 
Kishan
 
 
 
 | 
			   
			 
		   | 
		 
		
		  | Back to top | 
		  
		  	
		   | 
		 
		
		    | 
		 
		
		  | mpuetz | 
		  
		    
			  
				 Posted: Wed Jan 23, 2002 5:21 am    Post subject:  | 
				     | 
			   
			 
		   | 
		 
		
		   Centurion
 
 Joined: 05 Jul 2001 Posts: 149 Location: IBM/Central WebSphere Services 
  | 
		  
		    
			  
				Hi Kishan,
 
 
1. and 2.)
 
 
Is this a deployement or runtime error ? Your next post with the
 
exception list indicates runtime, right ?
 
 
The exceptionlist in your case can be interpreted as follows
 
don't know about the first insert
 
1 in second insert : line number
 
23 in third insert : column number
 
fourth insert: description of error
 
fifth: could be token it was currently parsing
 
 
it probably means your string executed in the eval statement is incorrect
 
at position 23, which would mean your CMSNAME contains bogus.
 
Maybe leading blanks or you didn't set the OutputDestinationList
 
within the same Node and forgot SET InputDestinationList = OutputDestinationList
 
in the beginning.
 
 
3. you can't. Use debug trace level and learn to read debug trace files
 
from your runs. This skill will save your sanity  .
 
 
4. Always include the complete statement within the EVAL string not
 
   just a partial one (I know it sometimes works for partial ones,
 
   too, but this is not very reliable).
 
 
   Also, I'm confused by your example: the SET function in your EVAL
 
   doesn't return a value which could assigned to something  
 
 
 
 
 _________________ Mathias Puetz
 
 
IBM/Central WebSphere Services
 
WebSphere Business Integration Specialist | 
			   
			 
		   | 
		 
		
		  | Back to top | 
		  
		  	
		   | 
		 
		
		    | 
		 
		
		  | kishankumar.v | 
		  
		    
			  
				 Posted: Wed Jan 23, 2002 11:11 am    Post subject:  | 
				     | 
			   
			 
		   | 
		 
		
		   Apprentice
 
 Joined: 26 Nov 2001 Posts: 47
  
  | 
		  
		    
			  
				Hi,
 
  Please look at the code below..
 
 
SET OutputDestinationList.ColumnMap[] = (SELECT RTRIM(A.SBLNAME)AS SBLNAME,RTRIM(A.CMSNAME) AS CMSNAME FROM Database.SBLCMS AS A WHERE A.TABLE_ID = '1');
 
DECLARE J INTEGER;
 
SET J = 1;
 
WHILE J <= CARDINALITY(OutputDestinationList.ColumnMap[]) DO
 
    EVAL('SET OutputRoot.XML.'||OutputDestinationList.ColumnMap[J].CMSNAME||' =   InputRoot.XML.'||OutputDestinationList.ColumnMap[J].SBLNAME||';'); 
 
END WHILE;
 
 
Here Iam trying to attach the XML tags from the database. 
 
THe outputDestinationList is filled with
 
ColumnMap[1]
 
   SBLNAME = 'fname             '
 
   CMSNAME = 'firstname         '
 
ColumnMap[2]
 
   SBLNAME = 'sname             '
 
   CMSNAME = 'secondname        '
 
ColumnMap[3]
 
   SBLNAME = 'eno               '
 
   CMSNAME = 'empno             '
 
 
But the above code results in a error ... 
 
Text            = 'XML Parsing Errors have occurred'
 
Text     = 'An error has been reported by the BIPXML4C component.'
 
Type = 2
 
          (0x3000000)Text = '1'
 
Type = 2
 
          (0x3000000)Text = '21'
 
        )
 
        (0x1000000)Insert   = (
 
          (0x3000000)Type = 5
 
          (0x3000000)Text = 'Expected comment or processing instruction'
 
        )
 
        (0x1000000)Insert   = (
 
          (0x3000000)Type = 5
 
          (0x3000000)Text = 'XML'
 
 
Please suggest what Iam missing. Its been a very long effort to resolve this without success.
 
 
Regards,
 
Kishan
 
 
 | 
			   
			 
		   | 
		 
		
		  | Back to top | 
		  
		  	
		   | 
		 
		
		    | 
		 
		
		  | kishankumar.v | 
		  
		    
			  
				 Posted: Wed Jan 23, 2002 11:21 am    Post subject:  | 
				     | 
			   
			 
		   | 
		 
		
		   Apprentice
 
 Joined: 26 Nov 2001 Posts: 47
  
  | 
		  
		    
			  
				Hi,
 
   Actually I did not check after writing RTRIM....before that the values in destinationlist contained spaces after the value which did not come in the above post...I think all spaces are bing truncated. 
 
Will the above syntax of RTRIM will work? and is the error really concerns that?
 
 
Regards,
 
Kishan
 
 | 
			   
			 
		   | 
		 
		
		  | Back to top | 
		  
		  	
		   | 
		 
		
		    | 
		 
		
		  | mpuetz | 
		  
		    
			  
				 Posted: Wed Jan 23, 2002 3:22 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		 
		
		   Centurion
 
 Joined: 05 Jul 2001 Posts: 149 Location: IBM/Central WebSphere Services 
  | 
		  
		    
			  
				Hi Kishan,
 
 
the code looks good, as far as I can tell.
 
I'm still suspicious thought about your DB
 
to fill the DestinationList.
 
What also makes me suspicious is the fact that you
 
get a parser error ? You should only get that
 
when your XML message is bogus. Are you sure the
 
message you put into the flow is valid XML ?
 
Maybe you were on the wrong track at all ?
 
 
If that is ok,
 
you can put the SELECT statement into a separate
 
compute node, with only Destination selected in the
 
Advanced tab.
 
Then put a trace node behind it printing the DestinationList
 
*and* Root to a file.
 
Then connect your old compute node with the XML mapping
 
putting a SET OutputDestinationList = InputDestinationList;
 
in front of your mapping loop.
 
 
That way you can make sure that your DestinationList
 
contains the correct values by verifying that they
 
show up in the trace file. Post the trace file in the
 
forum if you can't make sense of it.
 
How is your database table SBLCMS defined (data types) ?
 
 
 
 _________________ Mathias Puetz
 
 
IBM/Central WebSphere Services
 
WebSphere Business Integration Specialist | 
			   
			 
		   | 
		 
		
		  | Back to top | 
		  
		  	
		   | 
		 
		
		    | 
		 
		
		  | 
		    
		   | 
		 
	   
	 | 
   
 
  
	     | 
	 | 
	Page 1 of 1 | 
   
 
 
 
  
  	
	  
		
		  
 
  | 
		  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
  | 
  		 
	   
	 | 
   
 
  	 | 
	  |