Author |
Message
|
glen254 |
Posted: Sun Jan 08, 2006 10:06 pm Post subject: How to create a TLV parser |
|
|
Newbie
Joined: 08 Jan 2006 Posts: 4
|
I have a requirement to create a MRM model to parse a TLV string message
The input data comes in the format - TAG;LENGTH;DATA;
ACPROG(1);2;CBS;JOBNUM(1);9;ORD000001;
The data elements can also contain ";" which is also the delimiter in our case. The TLV elements can occur in any sequence and hence the order is not guaranteed. The number of fields occuring in a different message could range from 20 to 700.
I have used TDS (Tagged delimited parsers and Tagged Encoded Length parsers)
Can someone provide any pointers or references to create such kind of a parser? |
|
Back to top |
|
 |
elvis_gn |
Posted: Mon Jan 09, 2006 12:00 am Post subject: |
|
|
 Padawan
Joined: 08 Oct 2004 Posts: 1905 Location: Dubai
|
Hi glen254,
I dont think this can be validated in a Message set I could be wrong....
You have the following problems
1.
Quote: |
elements can occur in any sequence |
2.
Quote: |
number of fields occuring in a different message could range from 20 to 700 |
3.
Quote: |
data elements can also contain ";" which is also the delimiter |
I think you should use a common Starting compute in all your flows which will do message validation.
In it you can create the message structure by first reading the element till ";", then knowing its length which is till the next ";" and then picking that many characters from the string.
Do this in a while and keep inserting it into an output message structure.
Best of luck
Regards. |
|
Back to top |
|
 |
glen254 |
Posted: Mon Jan 09, 2006 12:58 am Post subject: |
|
|
Newbie
Joined: 08 Jan 2006 Posts: 4
|
My initial design was to implement the message parsing logic in ESQL but i found it a little too tedious.
Can't imagine that the message sets do not provide a model to parse TLV messages ...
The same functionality was easily implemented in Neon Formats which had a simple design and worked well in that case |
|
Back to top |
|
 |
elvis_gn |
Posted: Mon Jan 09, 2006 1:11 am Post subject: |
|
|
 Padawan
Joined: 08 Oct 2004 Posts: 1905 Location: Dubai
|
Hi glen254,
I was searching the net for any parsers which could be used for TLV's.
No luck yet, though Cisco mentions something about its latest release with TLV handling.
But you will have to get a parser which can be used with Broker, and also, since ur delimiter occurs within the data, that will be a problem unless the parser uses the length and not the delimiter for parsing.
Will let u know if I can find something. U can raise a request in the IBM site, I think.
Regards. |
|
Back to top |
|
 |
kimbert |
Posted: Mon Jan 09, 2006 5:02 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
elvis_gn: You are wrong on all three counts. The MRM TDS parser can handle an unknown number of occurrences, unordered data and length references.
glen254: Your instincts were correct. You need to use a Data Element Separation of Tagged Delimited for the outer Complex Type. For the complex type representing each record, I think Variable Length Elements Delimited will be the correct choice. That way, the Length field will expect a delimiter but the Data field will not (because you will have set the Length Reference field at the Length field).
Try it out and let me know how you get on. |
|
Back to top |
|
 |
elvis_gn |
Posted: Mon Jan 09, 2006 8:27 pm Post subject: |
|
|
 Padawan
Joined: 08 Oct 2004 Posts: 1905 Location: Dubai
|
Hi guys,
I knew we could handle two out of the three problems, I was not sure how we could ahndle the data with the delimiter within.
I totally forgot about using the field reference itself, my apologies.
Regards. |
|
Back to top |
|
 |
|