Author |
Message
|
farbman |
Posted: Fri Jan 28, 2011 2:40 am Post subject: tagged encoded length elements |
|
|
Newbie
Joined: 19 Sep 2008 Posts: 8
|
Hi,
I stumbled across a little bit weird tagged format where all the tagged elements are as following.
XXXXYYYYDDDDDDDDDDDDD
XXXX=Length of DDDDDD
YYYY=TAG
DDDD=Element Data
The record is fixed length in total but all elements in it are optional except the last element which is a filler up to the fixed length.
I failed to model this in the message set editor and will do all parsing in the jcn instead.
Anyone know if it is possible to parse a format like this in the message set in wmb 6.1?
If they just had swapped the XXXXYYYY fields then it would be not problem. But what if the length element is placed before the tag? |
|
Back to top |
|
 |
mqjeff |
Posted: Fri Jan 28, 2011 2:58 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
How did you try and model it?
I'd think something like
Code: |
complexType DataElementSeparation="FixedLength"
element name="Length" type = integer;
complexType DataElementSeparation="TaggedFixedLength" composition="choice"
element name="A" Tag="A" lengthReference="Length"
element name="B" Tag="B" lengthReference="Length"
element name="C" Tag="C" lengthReference="Length"
element name="D" Tag="D" lengthReference="Length" |
But then I guess I haven't double-checked if there are rules on using the same field for a length reference for more than one element.
You'd then create a repeating element of that outer type as the only child of your message. |
|
Back to top |
|
 |
kimbert |
Posted: Fri Jan 28, 2011 3:10 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Please can you give some more examples, with real data. Problems like this always require knowledge of the itty-bitty details. |
|
Back to top |
|
 |
farbman |
Posted: Fri Jan 28, 2011 4:47 am Post subject: |
|
|
Newbie
Joined: 19 Sep 2008 Posts: 8
|
I think that I can use the same data as found on http://publib.boulder.ibm.com/infocenter/wmbhelp/v6r1m0/index.jsp?topic=/com.ibm.etools.mft.doc/ad09830_.htm to illustrate the problem better.
Code: |
007tagAdataAAA006tagBdataBB009tagCdataCCCCC |
007,006,009 = Length of data element
tagA,tagB,tagC = Tag identifier
dataAAA,dataBB,dataCCCCC = element data
Actually this time I only read in every record and manually handle it in the jcn, just because I could not figure out how/if it could be solved in the message set.
It is possible to use the data element length as length reference for the data element. But another fun fact is that I need to identify the tag so the mapping could be dealt with.
I think that jeffs idea above might work. I will try it out. |
|
Back to top |
|
 |
farbman |
Posted: Fri Jan 28, 2011 4:59 am Post subject: |
|
|
Newbie
Joined: 19 Sep 2008 Posts: 8
|
That solution did work excellent  |
|
Back to top |
|
 |
mqjeff |
Posted: Fri Jan 28, 2011 5:23 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
farbman wrote: |
That solution did work excellent  |
As kimbert said, though, there may be itty-bitty details that will come back later and cause issues. So go through a number of rigorous test cases and validate the model against the actual data definition. |
|
Back to top |
|
 |
|