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 » MRM - TDS Parser

Post new topic  Reply to topic
 MRM - TDS Parser « View previous topic :: View next topic » 
Author Message
ranjitgopalan
PostPosted: Mon Apr 20, 2009 10:17 pm    Post subject: MRM - TDS Parser Reply with quote

Newbie

Joined: 19 Nov 2008
Posts: 8

I have a message with the following structure
Header (1)
Data (1..n)
Footer(1)
and the message looks like this
OP-----------------------------(Length 70) -> header
---------------------------------(Length 90) -> data
---------------------------------(Length 90) -> data
---------------------------------(Length 90) -> data
CL------------------------------(lentgth 70) -> footer

I had tried to use two approaches for parsing the message tagged delimited and fixed. Tagged delimited i dont have a tag for data as data tag is variable. Fixed length i am not able to parse till footer, the data is parsed till data and footer also it considers as data.

Any help on how this can be parsed would be welcome. Header i can identify by a tag OP and footer by CL but data i dont have a way to identify other than the length(90). how do i parse this in TDS.

Thanks in advance.
Back to top
View user's profile Send private message
MQEnthu
PostPosted: Mon Apr 20, 2009 10:29 pm    Post subject: Reply with quote

Partisan

Joined: 06 Oct 2008
Posts: 329
Location: India

I understand you are expecting the header, data and the footer to appear in new lines. In that case create the a complex element of type "All elements delimited" and set the delimiter to newline. And create the three complex elements under it of type fixed length for header, data and footer. And set repeating to -1 and set repeating element delimiter as newline for Data - complexType.

ComplexType - All elements delimiter (new line as delimiter)
Header - complexType Fixed Length
Data - complexType Fixed Length set repeating to -1 and set repeating element delimiter as newline
Footer- complexType Fixed Length


_________________
-----------------------------------------------
It is good to remember the past,
but don't let past capture your future
Back to top
View user's profile Send private message
kimbert
PostPosted: Tue Apr 21, 2009 12:34 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Hi,

This is the key point:
Quote:
but data i dont have a way to identify other than the length(90)

You will need to set Data Element Separation to 'Use Data Pattern' - All Elements Delimited will not work, and neither will Tagged Delimited.

You need something like this. It's not tested, and will probably need some adjustments, but it should put you on the right path:
Code:
Element name="message"
    complexType composition="choice", DataElementSeparation="Use Data Pattern", maxOccurs=-1
        element name="Header", DataPattern="OP[^\r]68\r\n"
            complexType composition="sequence", DataElementSeparation="FixedLength", GroupTerminator="<CR><LF>"
                element name="Header.1" ...
                element name="Header.2" ...
        element name="Body", DataPattern="[^\r]90\r\n"
            complexType composition="sequence", DataElementSeparation="FixedLength", GroupTerminator="<CR><LF>"
                element name="Body.1" ...
                element name="Body.2" ...
        element name="Footer", DataPattern="CL[^\r]68\r\n"
            complexType composition="sequence", DataElementSeparation="FixedLength", GroupTerminator="<CR><LF>"
                element name="Footer.1" ...
                element name="Footer.2" ...


Note that this will allow the header, body and footer to appear in any order. If you want to enforce the ordering then you will need a more complex model.
Back to top
View user's profile Send private message
ranjitgopalan
PostPosted: Tue Apr 28, 2009 6:19 am    Post subject: Reply with quote

Newbie

Joined: 19 Nov 2008
Posts: 8

Thanks kimbert it worked. Composition sequence worked fine but it also work with choice by which i could get the records any where.
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 » MRM - TDS Parser
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.