Author |
Message
|
tigerstone |
Posted: Tue Feb 11, 2014 7:18 am Post subject: Message Model Parser Issue |
|
|
Novice
Joined: 06 Feb 2014 Posts: 20
|
Records 1,2,A,B,C,8,9 appear in input data
Example of Input Message
1qpio
2lkmj
Ahgty
Bvfry
Ciupl
8iyrm
9nugf
1 & 9 records-> File Header and Trailer (only once in file)
2 & 8 records-> Batch Header and Trailer (Repeats)
A,B and C records-> Transaction, Order and Control (Repeats n times between Batch Header and Trailer). Also Within this Batch C's can be multiple.
Message Model is as below. Each complex type (File Header, Batch Header, Transaction, Order, Control, Batch Trailer, File Trailer) is Fixed Length with Group Indicators 1,2,A,B,C,8,9.
1
2
A
B
C
8
9
Record types Transaction, Order and Control are Grouped under complex type BATCH with delimter <CR><LF>
1
2
BATCH
8
9
Complex Types Batch Header, Batch and Batch Trailer are Grouped under FILE where All Elements delimited with <CR><LF>
1
FILE
9
The message model should be able to parse any valid input message.
1
2
A
B
C
C
C
A
B
C
8
9
In this case It is unable to parse the A's right after the C's.
A complex type S with local element C [0,-1], Data element separation: Tagged Delimited set Group Terminator: A, Delimiter <CR><LF> worked i.e BATCH complex type consists of A, B and S.
When trying to parse for the case with no C's.
1
2
A
B
A
B
A
B
8
9
Here it is unable to parse an A right after a B.
However it is able to parse a situation where 8 follows right after a B .
How is the message model to handle such a scenario or any valid data input for that matter?
Last edited by tigerstone on Tue Feb 11, 2014 8:17 am; edited 1 time in total |
|
Back to top |
|
 |
Vitor |
Posted: Tue Feb 11, 2014 7:22 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Which version of software, i.e. is this model MRM or DFDL? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
tigerstone |
Posted: Tue Feb 11, 2014 7:59 am Post subject: |
|
|
Novice
Joined: 06 Feb 2014 Posts: 20
|
|
Back to top |
|
 |
Vitor |
Posted: Tue Feb 11, 2014 8:25 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
"Unable to parse" is not that descriptive. What exactly is the error and what does that indicate about what the parser expected to find?
Have you taken a user trace to determine what the parser has matched up to that point, to verify that what you think is the problem is in fact the final outcome of any earlier modeling problem? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Feb 11, 2014 8:29 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
You probably need to check / remove your group terminator...  _________________ MQ & Broker admin |
|
Back to top |
|
 |
kimbert |
Posted: Tue Feb 11, 2014 8:48 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
My advice:
- Use Tagged Delimited for the outermost level, and for any complex type/group that contains records.
- Replace Group Indicators with Tags
- Use All Elements Delimited only when the data is not tagged.
- When posting on this forum, use [c o d e ] tags to make your posts more readable - especially when posting code, XML or descriptions of models. All of these benefit from using the fixed-with font.
- Take a debug-level user trace of the parse, and read it carefully. If you can't work out what it is trying to tell you then post the *relevant* snippets here ( in code tags ) and ask specific questions backed up with data. _________________ 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 |
|
 |
kimbert |
Posted: Tue Feb 11, 2014 8:50 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
...or even better, upgrade to v8/v9 and use DFDL. But I realize that may not be an option right now. _________________ 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 |
|
 |
mqjeff |
Posted: Tue Feb 11, 2014 8:57 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
It seems relatively clear to me that A,B,C are in a sequence, but are expected to be non-sequential.
That is, a repeating choice, rather than a repeating sequence. |
|
Back to top |
|
 |
tigerstone |
Posted: Tue Feb 11, 2014 9:04 am Post subject: |
|
|
Novice
Joined: 06 Feb 2014 Posts: 20
|
Error Event Viewer
( LOCAL_BRKR01.EG2 ) An MRM parsing error has occurred. The bit stream of the message being parsed by the MRM parser is larger than expected for a message of this type.
Number of bytes parsed: 289
Actual length of message: 139199
When parsing the instance message according to the message model, the parser reached the end of the message definition before it reached the end of the bit stream. Either the message bit stream has been incorrectly constructed, or the message model is incorrect.
Ensure that the message bit stream is correctly formed.
Ensure that the message properties (name, physical format, message set) are correct.
Ensure that the message model for this message type is correct. In particular, check that the element lengths and number of repeats are correct. You should find the message set and message type quoted in other error messages.
If this is a TDS message, enable user trace (debug level) and parse the message. In the trace file check the messages issued by the TDS parser to find the problem. |
|
Back to top |
|
 |
Vitor |
Posted: Tue Feb 11, 2014 9:15 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
So your message model only describes 289 bytes of the message; what's at that position? Does that offer any clues why the parser might think byte 289 marks the end of the message?
What did the user trace offer you by way of help? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
dogorsy |
Posted: Tue Feb 11, 2014 9:20 am Post subject: |
|
|
Knight
Joined: 13 Mar 2013 Posts: 553 Location: Home Office
|
mqjeff wrote: |
It seems relatively clear to me that A,B,C are in a sequence, but are expected to be non-sequential.
That is, a repeating choice, rather than a repeating sequence. |
can you please explain what your contribution is ?. |
|
Back to top |
|
 |
kimbert |
Posted: Tue Feb 11, 2014 9:45 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
@tigerstone: I'll just summarize the situation for you.
- mqjeff believes that your A,B,C can be in a different order. You might want to confirm/deny that.
- vitor has correctly interpreted the error message. That error message usually appears when the model is not correct. Unfortunately, it's almost useless for diagnosing the real problem. The source of your problem will be revealed by a debug-level user trace - but make the changes that I suggested first.
- dogorsy is very keen for everybody to make a contribution  _________________ 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 |
|
 |
mqjeff |
Posted: Tue Feb 11, 2014 9:52 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
kimbert wrote: |
- mqjeff believes that your A,B,C can be in a different order. You might want to confirm/deny that. |
based on
tigerstone wrote: |
1
2
A
B
C
C
C
A
B
C
8
9
In this case It is unable to parse the A's right after the C's. |
Look, it's an A that follows a C, in what is described as a 'correct' message. Now, maybe I'm slightly misunderstanding, maybe it does always have to be one or more A's followed by one or more B's followed by one or more C's with that whole set to repeat. But maybe it's just that it's any order of A, B, and C.
So either the sequence that contains A,B,C needs to be repeating, or the sequence containing A,B,C needs to be a repeating choice.
kimbert wrote: |
- dogorsy is very keen for everybody to make a contribution  |
No, he's just hoping to tweak my nose after I gave him grief in another post. |
|
Back to top |
|
 |
dogorsy |
Posted: Tue Feb 11, 2014 10:02 am Post subject: |
|
|
Knight
Joined: 13 Mar 2013 Posts: 553 Location: Home Office
|
[quote="kimbert]
- dogorsy is very keen for everybody to make a contribution [/quote]
not really. I just want people to give good advice. And if they do not know what they are talking about, keep the mouth shut !
Ok. to be honest with you all, and after having been to a decent uni, it was nice to learn that ABC is a sequence.... |
|
Back to top |
|
 |
tigerstone |
Posted: Tue Feb 11, 2014 10:55 am Post subject: |
|
|
Novice
Joined: 06 Feb 2014 Posts: 20
|
Brothers. . Take it easy. . Why So Serious .. My goal is to master the subject like each of you all. I can see everyone here is really passionate and adept with their craft in WMB/MQ but all the fighting and extreme competitiveness is taking out the fun in learning. Why cant we all just be friends who share the same passion. |
|
Back to top |
|
 |
|