|   | 
	 
  
    | 
RSS Feed - WebSphere MQ Support
 | 
RSS Feed - Message Broker Support
 |   
 
  
	     | 
	 | 
   
 
  
	|  To show msg from flat file into XML | 
	« View previous topic :: View next topic »  | 
   
  
  	
	  
		
		
		  | Author | 
		  Message
		 |  
		
		  | saurabh.mk2003 | 
		  
		    
			  
				 Posted: Mon Oct 29, 2007 5:28 am    Post subject: To show msg from flat file into XML | 
				     | 
			   
			 
		   | 
		 
		
		   Novice
 
 Joined: 27 May 2007 Posts: 10
  
  | 
		  
		    
			  
				Hi,
 
   
 
               I have a carrot delimited file containing header & line items. The format of this input file is  ::
 
 
01^empid^empname^empadd
 
02^id^name               
 
 
 
 
where '01'  represents headers  &  '02'  represents line items.
 
I  want to  bring this file in XML format  in RFH util.
 
In its  compute node, I have written the logic  ::
 
 
 
 
CREATE COMPUTE MODULE MF_Exam_Compute
 
	CREATE FUNCTION Main() RETURNS BOOLEAN
 
	BEGIN
 
		 CALL CopyMessageHeaders();
 
		 CALL CopyEntireMessage();
 
		 
 
		 
 
		  DECLARE parseOptions INTEGER BITOR(ValidateValue, ValidateContent,ValidateException, ValidateComplete, ValidateFullConstraints);
 
		 CREATE LASTCHILD OF Environment.Variables DOMAIN 'MRM' PARSE(InputRoot.BLOB.BLOB OPTIONS parseOptions SET 'dfd' TYPE 'Rec-type' FORMAT 'TDS1');
 
		 DECLARE Record_Ref REFERENCE TO Environment.Variables.MRM; --Reference to the MRM data
 
		 
 
		RETURN TRUE;
 
	END;
 
 
	CREATE PROCEDURE CopyMessageHeaders() BEGIN
 
		DECLARE I INTEGER;
 
		DECLARE J INTEGER;
 
		SET I = 1;
 
		SET J = CARDINALITY(InputRoot.*[]);
 
		WHILE I < J DO
 
			SET OutputRoot.*[I] = InputRoot.*[I];
 
			SET I = I + 1;
 
		END WHILE;
 
	END;
 
 
	CREATE PROCEDURE CopyEntireMessage() BEGIN
 
		SET OutputRoot = InputRoot;
 
	END;
 
END MODULE;
 
 
 
 
 
 
 
After running this, it is  showing only the headers  in the Environment tree.  And also the message is not coming in the XML format.
 
 
Could you plz pick out  and tell where i am going wrong ? | 
			   
			 
		   | 
		 
		
		  | Back to top | 
		  
		  	
		   | 
		 
		
		    | 
		 
		
		  | jefflowrey | 
		  
		    
			  
				 Posted: Mon Oct 29, 2007 5:36 am    Post subject:  | 
				     | 
			   
			 
		   | 
		 
		
		   Grand Poobah
 
 Joined: 16 Oct 2002 Posts: 19981
  
  | 
		  
		    
			  
				Are there parse errors in the broker log?
 
 
You won't get it as XML unless you do something to make it XML.
 
 
For example if you have an XML physical layer on the same message definition, you still have to set the FORMAT to 'XML1', for example, before you output.
 
 
This would be AFTER you've done the CREATE... PARSE.  And you'll have to assign the Environment.Variables.MRM to OutputRoot.MRM at some point, too, if you want it to show up on the output message. _________________ I am *not* the model of the modern major general. | 
			   
			 
		   | 
		 
		
		  | 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
  | 
  		 
	   
	 | 
   
 
  	 | 
	  |