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 » DFDL Parse data containing delimiter

Post new topic  Reply to topic
 DFDL Parse data containing delimiter « View previous topic :: View next topic » 
Author Message
elvis_gn
PostPosted: Tue Apr 24, 2018 11:00 pm    Post subject: DFDL Parse data containing delimiter Reply with quote

Padawan

Joined: 08 Oct 2004
Posts: 1905
Location: Dubai

Hi guys,
I have an issue parsing a record delimited message. The high-level structure is as follows:
Quote:
"HEADER", "value1", "value2"
"BODY","value3","value4"
"FOOTER","value5","value6_contains_comma(,)_inside"

Note: each value is in double quotes, and I need to get rid of it in the parsed data.

I've successfully parsed FOOTER till 'value5' getting rid of the double quotes by setting the FOOTER sequence separator as comma(,) and child element level initiator and terminator as double quotes(").

The issues lies where FOOTER contains a value6 with a comma within the data. From other posts, I understood I could try a 'pattern=.*' and this worked, but only without the initiator and terminator of quote(") on the field itself. In which case the value got captured with the quotes.

If I set the initiator and terminator as double quotes("), then I get parser errors at the initiator (but error icon on sequence) saying
Quote:
Unexpected data found at offset 'XYZ'
XYZ is the location of the opening quote.

Any ideas on how to get rid of the quotes ?
Back to top
View user's profile Send private message Send e-mail
timber
PostPosted: Wed Apr 25, 2018 1:11 am    Post subject: Reply with quote

Grand Master

Joined: 25 Aug 2015
Posts: 1280

I assume that you are using DFDL. Did you create your model using the 'New/Message Model...' wizard?
Back to top
View user's profile Send private message
elvis_gn
PostPosted: Wed Apr 25, 2018 3:38 am    Post subject: Reply with quote

Padawan

Joined: 08 Oct 2004
Posts: 1905
Location: Dubai

I started with the wizard, but my body tag is more complicated than what I've posted below. The body has child segments that are to be parsed as child elements, but are actually under the body hierarchy level.

i.e It is supposed to be like the below
Quote:
HEADER
BODY
---TYPE_1
---TYPE_2
------TYPE_3
BODY
---TYPE_2
------TYPE_1
FOOTER


But comes in as
Quote:
HEADER
BODY
TYPE_1
TYPE_2
TYPE_3
BODY
TYPE_2
TYPE_1
FOOTER


Hence the default wizard generated model got tweaked a lot.

Is that a problem ?
Back to top
View user's profile Send private message Send e-mail
fjb_saper
PostPosted: Wed Apr 25, 2018 4:06 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20696
Location: LI,NY

There should be no problem of it coming in like you say.
When building your record all you need to do is say something like
Code:
Header
  Body  occurs 1 to x
     choice occurs 1 to x
        Type 1
        Type 2
        Type 3
     -- end choice
Footer


Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
elvis_gn
PostPosted: Wed Apr 25, 2018 5:11 am    Post subject: Reply with quote

Padawan

Joined: 08 Oct 2004
Posts: 1905
Location: Dubai

Not really...

Body first has simple fields that are comma separated. Then there are unordered complex elements that could be 0 to unbounded. There is no comma between the simple and complex elements, only CRLF.

Anyway, I crossed that bridge and reached the last element. The only problem right now is to escape the sequence separator comma inside an element value.

How can I do that while getting rid of the quotes ?
Back to top
View user's profile Send private message Send e-mail
timber
PostPosted: Wed Apr 25, 2018 6:15 am    Post subject: Reply with quote

Grand Master

Joined: 25 Aug 2015
Posts: 1280

The DFDL default escape scheme (which will have been set up by the wizard) will automatically remove the quotes. Do some experiments and and check the DFDL docs.
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 » DFDL Parse data containing delimiter
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.