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 » Reading text file using MRM domain

Post new topic  Reply to topic
 Reading text file using MRM domain « View previous topic :: View next topic » 
Author Message
chenna.hari
PostPosted: Mon Dec 27, 2010 1:43 am    Post subject: Reading text file using MRM domain Reply with quote

Centurion

Joined: 21 Mar 2009
Posts: 103

Hi,

I have a text file in below format

Quote:

A:value1, B:value2, C:value3, D:value4

1.E:value5
2.F:value6
3.G:value7
4.H:value8


and i need to read this file in Message broker and transform to below xml format
Quote:

<output>
<A>value1</A>
<B>value2</B>
<C>value3</C>
<D>value4</D>
<E>value5</E>
<F>value6</F>
<G>value7</G>
<H>value8</H>
</output>


do you have any suggestions how to transform, please let me know
Back to top
View user's profile Send private message
mqjeff
PostPosted: Mon Dec 27, 2010 2:54 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

You create a message model that matches the input file.

You then write ESQL to create the output XML document.

Welcome to Broker, please get training and do your own learning.
Back to top
View user's profile Send private message
chenna.hari
PostPosted: Mon Dec 27, 2010 3:52 am    Post subject: Reply with quote

Centurion

Joined: 21 Mar 2009
Posts: 103

ok. but i would like to get suggestion on how to create the message model using MRM.

how to model this??
Back to top
View user's profile Send private message
kimbert
PostPosted: Mon Dec 27, 2010 5:08 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Your message is a classic 'Tagged Delimited' format. The delimiter is comma, and the tags are 'A', 'B', 'C'. You need to
- create a new message set
- add a TDS physical format
- create a message definition file with this structure:
Code:
element name="messageRoot"
    complexType DataElementSeparation="Tagged Delimited" Delimiter="," TagLength="2"
        element name="A" Tag="A:"
        element name="B" Tag="B:"
        element name="C" Tag="C:"
        element name="D" Tag="D:"
        ...


Your ESQL is trivial. Just copy the MRM message tree to OutputRoot.XMLNSC. Like this:
Code:
SET OutputRoot.XMLNSC.output = InputRoot.MRM;
Back to top
View user's profile Send private message
optimist
PostPosted: Mon Dec 27, 2010 3:22 pm    Post subject: Reply with quote

Apprentice

Joined: 18 Nov 2010
Posts: 33

Is it exactly this mixed format?

A:value1, B:value2, C:value3, D:value4

1.E:value5
2.F:value6
3.G:value7
4.H:value8

OR, just:

A:value1, B:value2, C:value3, D:value4, E:value5, F:value6, G:value7, H:value8

I am not sure I understand your requirement in full. More (exact) details on the input format will help.
Back to top
View user's profile Send private message
chenna.hari
PostPosted: Mon Dec 27, 2010 9:03 pm    Post subject: Reply with quote

Centurion

Joined: 21 Mar 2009
Posts: 103

It is Exactly mixed format which i mentioned
Quote:

A:value1, B:value2, C:value3, D:value4

1.E:value5
2.F:value6
3.G:value7
4.H:value8

note: length of tags A, B, C, D,.... will not be equal
Back to top
View user's profile Send private message
mqjeff
PostPosted: Tue Dec 28, 2010 2:32 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

TDS can still handle this.
You just need to adjust the model given to match the tags in use.

The model you were given will actually handle this as well. You just might not like how element D ends, for example.
Back to top
View user's profile Send private message
kimbert
PostPosted: Tue Dec 28, 2010 4:08 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
note: length of tags A, B, C, D,.... will not be equal
You need to
- change the tags to "A", "B" etc ( so remove the colon )
- set the Tag Data Separator to colon (
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 » Reading text file using MRM domain
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.