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 » Customize delimiter in message model

Post new topic  Reply to topic
 Customize delimiter in message model « View previous topic :: View next topic » 
Author Message
harry123
PostPosted: Mon Feb 18, 2013 11:38 am    Post subject: Customize delimiter in message model Reply with quote

Newbie

Joined: 30 Oct 2012
Posts: 9

Hi

I have modeled a CSV message using DFDL parser in WMB V8. The message looks as:

BASIC|359656||0250157841|10182012

Now I need to create another message model with 2 different delimiters.

sample message as this:

BASIC=359656||0250157841|10182012

where '=' is a delimiter for first element and for all rest of the elements, the delimiter is '|'.

In message model, I see that we set the separator property to a default value (like ',' '|') for all the elements one time in the sequence properties.

Is there any way we could set the separator individually for each element.

Thanks,
Harry
Back to top
View user's profile Send private message
kimbert
PostPosted: Mon Feb 18, 2013 1:12 pm    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
'=' is a delimiter for first element
I wonder...is it really a delimiter. Or is 'BASIC=' an initiator for the whole record?

Quote:
Is there any way we could set the separator individually for each element
There is. But I don't think you need that. it looks as if most of the elements are using |. It is only the first element that has 'BASIC=' before it. And that could be modelled as an initiator.

If you really do need a different separator for each element then you can set either the initiator or the terminator property on each element.
Back to top
View user's profile Send private message
harry123
PostPosted: Mon Feb 18, 2013 2:23 pm    Post subject: Reply with quote

Newbie

Joined: 30 Oct 2012
Posts: 9

Hi Kimbert,

BASIC= is not an initiator for my whole record.

BASIC is the value of my first element and = is the delimiter for that element.

When I set the terminator property of my first element to '=' , the parsing was unsuccessful with the following error.

Separator is missing for 'sequence' group contained within element 'BASIC'.
Back to top
View user's profile Send private message
kimbert
PostPosted: Mon Feb 18, 2013 3:06 pm    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Here's what is happening:
1. the DFDL parser successfully parses the first element, and assigns the value 'BASIC' to it
2. The terminator '=' for the first element is also found successfully.
3. The sequence group that contains the first element ( and all the others ) has a separator of |. So the next thing that the parser expects is a separator. It doesn't find a | in the data, so it complains.

I assume that you have seen all of this in the DFDL Trace view in the WMB toolkit?

Your model currently looks like this:
Code:
Root
    Complex Type
        Sequence Group separator='|'
            element1 terminator='='
            element2
            ...
            elementN

You need to change it to look like this:
Code:
Root
    Complex Type
        Sequence Group separator='' ( i.e. no separator )
            element1 terminator='='
            Sequence Group separator='|'
                element2
                ...
                elementN

Alternatively, remove the terminator on element 1 and set the separator for its parent sequence group to '='. Your choice.
Back to top
View user's profile Send private message
harry123
PostPosted: Mon Feb 18, 2013 3:14 pm    Post subject: Reply with quote

Newbie

Joined: 30 Oct 2012
Posts: 9

Thank you Kimbert. That really helps.
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 » Customize delimiter in message model
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.