Author |
Message
|
senzo |
Posted: Tue Oct 21, 2014 1:32 am Post subject: MRM parsing error |
|
|
Newbie
Joined: 21 Oct 2014 Posts: 4
|
hi all i am trying to pass below message using MRM parser. thing is it cannot differentiate between the 2 record types R0 and R3 respectively any Idea. note the fields are fixed length so i can't use tagged delimited in the child type
7101R0456|
7101R3james|
7101R3names|
7101R3name1|
7101R0456|
7101R3james|
7101R3names|
7101R3name1| |
|
Back to top |
|
 |
smdavies99 |
Posted: Tue Oct 21, 2014 2:03 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
Why are you trying to use the MRM Parser?
If you are running on Broker 8.0.0.0 or later then you really should be using DFDL. _________________ 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 |
|
 |
senzo |
Posted: Tue Oct 21, 2014 2:19 am Post subject: |
|
|
Newbie
Joined: 21 Oct 2014 Posts: 4
|
thing is I am running on broker 7.0.0.5 and it doesn't have DFDL parser option |
|
Back to top |
|
 |
Vitor |
Posted: Tue Oct 21, 2014 5:19 am Post subject: Re: MRM parsing error |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
senzo wrote: |
thing is it cannot differentiate between the 2 record types R0 and R3 respectively |
Why not? What happens?
senzo wrote: |
note the fields are fixed length so i can't use tagged delimited in the child type |
a) the sample you posted looks to be delimiter by a |
b) Many "fixed length" records are delimited by EOL
c) All fixed length records can, by definition, have a delimiter added at the correct point (i.e. after the number of bytes that describe the record) _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
mqjeff |
Posted: Tue Oct 21, 2014 5:33 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Aside from what my esteemed colleague has said, there are two additional comments.
- MRM supports Tagged-Fixed length as well as Tagged-Delimited
- This is a Message Broker/IIB thread, perhaps it could be moved there
|
|
Back to top |
|
 |
senzo |
Posted: Tue Oct 21, 2014 5:59 am Post subject: |
|
|
Newbie
Joined: 21 Oct 2014 Posts: 4
|
Thanks Jeff for your response.
We can use Tagged delimited but, if you look at the structure
7101R0456|
I can make R0 as the Tag only when, 7101 does not exist where complex type is Tagged delimited.
My message definition works fine for this R0456|
When i am trying to put Complex type as Fixed and inside that Tagged delimited complex type. Broker gives a problem "Structure cannot have Tagged delimited when parent structure is Fixed length".
I just want a way by which message defintion can understand 7101 is having length as 4 and other elements are tagged delimited where R0 is the Tag.
If we get a solution for above, we can surely pass R3 records as well.
Please help. |
|
Back to top |
|
 |
mqjeff |
Posted: Tue Oct 21, 2014 6:10 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
"Tagged-Delimited" is very very distinct from "Tagged-Fixed Length".
MRM supports both.
Your message is Tagged-Fixed Length.
You have a tag that identifies the record type and then the record itself is a fixed length structure.
MRM also lets you create arbitrary substructures to enclose constraints. So if you have a tagged-delimited field followed by a fixed length field followed by a delimited field, you can create substructures as needed to support those or simply put the necessary properties on the right things.
There are examples in the Samples Gallery for MRM that may help you understand what you need to change to get your model working.
I'd also recommend creating a simple test flow that receives a message and then passes it to a Trace node. This will allow you to see how your message is being parse - absent an MRM version of the DFDL Test Parser. |
|
Back to top |
|
 |
Vitor |
Posted: Tue Oct 21, 2014 6:23 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
senzo wrote: |
When i am trying to put Complex type as Fixed and inside that Tagged delimited complex type. Broker gives a problem "Structure cannot have Tagged delimited when parent structure is Fixed length". |
I repeat my comments above - why is the parent structure Fixed Length? Do not attempt to answer "because it's a fixed number of byte".
senzo wrote: |
I just want a way by which message defintion can understand 7101 is having length as 4 and other elements are tagged delimited where R0 is the Tag. |
Explain to me carefully why 7101 can't be a tag than happens to be 4 bytes long. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
senzo |
Posted: Tue Oct 21, 2014 6:58 am Post subject: |
|
|
Newbie
Joined: 21 Oct 2014 Posts: 4
|
I cannot put 7101 as tag as, it can be anything(8101, 6101) and I want this field in my output structure. |
|
Back to top |
|
 |
mqjeff |
Posted: Tue Oct 21, 2014 7:05 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
So you have a structure like this:
Code: |
Message
sequence - delimited by a | (and probably a newline)
Fixed Length element - occurs 0 to 1 or 1 to 1
choice
R0 record - tagged, fixed length
sequence
field1
field2
.....
R1 record - tagged, fixed length
..... |
|
|
Back to top |
|
 |
Vitor |
Posted: Tue Oct 21, 2014 7:21 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
mqjeff wrote: |
So you have a structure like this:
Code: |
Message
sequence - delimited by a | (and probably a newline)
Fixed Length element - occurs 0 to 1 or 1 to 1
choice
R0 record - tagged, fixed length
sequence
field1
field2
.....
R1 record - tagged, fixed length
..... |
|
 _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
|