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 IndexWebSphere Message Broker (ACE) SupportDFDL parser custom record layout. Not parsing input record.

Post new topicReply to topic
DFDL parser custom record layout. Not parsing input record. View previous topic :: View next topic
Author Message
kathirvelt
PostPosted: Thu Jun 05, 2014 2:29 pm Post subject: DFDL parser custom record layout. Not parsing input record. Reply with quote

Apprentice

Joined: 02 Oct 2010
Posts: 32

We are receiving text data in below format and I have created DFDL parser to parse the record. The detail and trailer record is decided based on the 3 element. Can we use DFDL parser for this type of records. When I test the parser I got an error at the end of first trailer record. From the error I understand that this is because of the “Occurs count kind” I’m not sure what should I set in Occurs count kind to parse this type of record.

Field value that had 1 in 3rd position is detail record and that has 89 is group trailer record.

Please let me know your suggestions.

INIT,4,1,data1,data2,1,10.0
INIT,4,1,data1,data2,2,10.0
INIT,4,1,data1,data2,5,10.0
INIT,4,89,xyz,5,50.0
ABC,4,1,data1,data2,1,10.0
ABC,4,1,data1,data2,2,10.0
ABC,4,1,data1,data2,5,10.0
ABC,4,89,xyz,5,50.0


Error Message:

Jun 5, 2014 10:05:36 AM error: CTDP3058E: Separator ',' not found at offset '107' for sequence or choice within element '/CBS_In[1]/record[4]'.

Jun 5, 2014 10:05:36 AM info: Offset: 107. Parser was unable to resolve data on the current branch and will evaluate the next available branch beginning at offset '87' owned by the 'sequence' group contained within element 'CBS_In'.
[dfdl = /MFL_CBS_PAS/CBS_In.xsd, scd = #xscd(/schemaElement::CBS_In/type::0/model::sequence), 210]
Jun 5, 2014 10:05:36 AM info: Offset: 87. Occurrence '4' of element 'record' was not found in the data. occursCountKind is 'implicit' so no more occurrences of this element will be expected.
[dfdl = /MFL_CBS_PAS/CBS_In.xsd, scd = #xscd(/schemaElement::CBS_In/type::0/model::sequence/schemaElement::record), 169]

Jun 5, 2014 10:05:36 AM info: Offset: 87. Up to '-1' occurrences of element 'trailer' will be expected because occursCountKind='implicit' and maxOccurs='-1'.
[dfdl = /MFL_CBS_PAS/CBS_In.xsd, scd = #xscd(/schemaElement::CBS_In/type::0/model::sequence/schemaElement::trailer), 135]

Jun 5, 2014 10:05:36 AM info: Offset: 87. Starting to process element 'trailer'.
[dfdl = /MFL_CBS_PAS/CBS_In.xsd, scd = #xscd(/schemaElement::CBS_In/type::0/model::sequence/schemaElement::trailer), 58]
Back to top
View user's profile Send private message
kimbert
PostPosted: Fri Jun 06, 2014 1:59 am Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

This has come up several times now. We really need a video tutorial for this scenario.

You need to tell the DFDL parser how to recognize a 'detail' record and a 'trailer' record. You must do that by adding discriminators to those records.
The discriminator contains an XPath expression that evalutes to 'true' if the record is the correct type.

You logical mode should be structured like this:
Code:
Message
    element name="DetailAndTrailer"
                maxOccurs="unbounded"
                occursCountKind="implicit"
        element name="detailRecord"   
                    maxOccurs="unbounded"
                    occursCountKind="implicit"
                    <discriminator required on this element>
        element name="trailerRecord"   
                    maxOccurs="unbounded"
                    occursCountKind="implicit"
                    <discriminator required on this element>

_________________
Before you criticize someone, walk a mile in their shoes. That way you're a mile away, and you have their shoes too.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Fri Jun 06, 2014 9:13 am Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

kimbert wrote:
We really need a video tutorial for this scenario.


That sounds like an excellent thing for someone on the parsers team to create...
Back to top
View user's profile Send private message
Vitor
PostPosted: Fri Jun 06, 2014 9:39 am Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

mqjeff wrote:
kimbert wrote:
We really need a video tutorial for this scenario.


That sounds like an excellent thing for someone on the parsers team to create...


"Mr <kimbert's real name>, we're ready for your close up now...."
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
kimbert
PostPosted: Sat Jun 07, 2014 11:14 am Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

yes, yes. Subtle hints received loud and clear
I am planning to do some DFDL videos sometime soon, hence the comment.
_________________
Before you criticize someone, walk a mile in their shoes. That way you're a mile away, and you have their shoes too.
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Jun 09, 2014 4:13 am Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

kimbert wrote:
yes, yes. Subtle hints received loud and clear
I am planning to do some DFDL videos sometime soon, hence the comment.


You could do some trial run throughs at the Beta workshop, where the informed and highly skilled audience can offer constructive criticism and help.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
shanson
PostPosted: Wed Jun 11, 2014 12:32 am Post subject: Reply with quote

Partisan

Joined: 17 Oct 2003
Posts: 344
Location: IBM Hursley

An example on the DFDLSchemas GitHub site would go a long way to helping users. I'll put one up there when I get the time.
Back to top
View user's profile Send private message
smdavies99
PostPosted: Wed Jun 11, 2014 2:06 am Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

Vitor wrote:
kimbert wrote:
yes, yes. Subtle hints received loud and clear
I am planning to do some DFDL videos sometime soon, hence the comment.


You could do some trial run throughs at the Beta workshop, where the informed and highly skilled audience can offer constructive criticism and help.


Ah, you mean where the audience just shout 'boo-Hiss' instead of throwing rotten eggs at the presenter?


{ah the memories of Saturday Morning Pictures at the Embassy Cinema}
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
shanson
PostPosted: Mon Jun 23, 2014 6:35 am Post subject: Reply with quote

Partisan

Joined: 17 Oct 2003
Posts: 344
Location: IBM Hursley

Is it worth making this thread sticky for a while, with a suitably improved title?
Back to top
View user's profile Send private message
Display posts from previous:
Post new topicReply to topic Page 1 of 1

MQSeries.net Forum IndexWebSphere Message Broker (ACE) SupportDFDL parser custom record layout. Not parsing input record.
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.