|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
TDS Definition Problem |
« View previous topic :: View next topic » |
Author |
Message
|
asamanta |
Posted: Thu Aug 21, 2003 1:22 am Post subject: TDS Definition Problem |
|
|
Novice
Joined: 20 Aug 2003 Posts: 18
|
Hi,
I'm a newbie & couldn't find a solution to the following -
Sample message
Code: |
CSBRECORDSCSBCD070000001000000380164
PROD1080511267660300992617400020A
SPEC6603003500020100224567843500020100265941730001020030101FRE
SPEC6703003600020100224567843600020100265941730002 20040101FRE
SPEC6703003600020100224567843600020100265941730002 20040101FRE
PROD108051127767060299271 00010B
SPEC66030039000201002659417340000201002659417400 2020031212FRE
PROD1080511267660300992817 00020C
SPEC6703003200020100265941733300020100265941741202020020101FRE
SPEC6803003100020100265941733300020100265941740001020040101FRE
SPEC6603003500020100265941733500020100265941740002 20030101FRE
TRLR00012 |
where, PROD, SPEC, TRLR could be termed as Group Indicators or Tags.
I've tried
Code: |
MyMsg CT, Ordered, VLED+Delim=<LF>
- HDRRec : CT, Ordered, (FL or VLED+Delim=|)
- DTLRec : CT, Ordered, VLED+Delim=<LF>, {Repeat=Yes, RED=<LF>}
- PRODRec : CT, Ordered, (FL or VLED+Delim=|)
- SPECRec : CT, Ordered, VLED+Delim=<LF>, {Repeat=Yes, RED=<LF>}
- TRLRRec : CT, Ordered, (FL or VLED+Delim=|)
Note: CT -> Compound Type, FL -> Fixed Length,
VLED -> Variable Length Elements Delimited,
RED -> Repeating Elements Delimiter
|
Would be obliged if any of you could throw some light!
Regards. |
|
Back to top |
|
 |
Craig B |
Posted: Thu Aug 21, 2003 1:35 am Post subject: |
|
|
Partisan
Joined: 18 Jun 2003 Posts: 316 Location: UK
|
Hi,
Can your PROD and SPEC structures repeat any number of times, or is this the same sized message all the time? If you have an unknown number of fixed length repetitions that are not children of other such identifiable separators (such as delimited parents etc), then this could cause problems in knowing where repetitions actually terminate. In this case you have a <LF> that should be able to separate out the elements, however this is the same delimiter as in the parent. This will make it difficult for the TDS parser to know where the child element SPECRec finishes, and when the next DTLRec starts. In fact it wont know unless you have specified minOccurs and maxOccurs to the same value, thus giving a known number of repetitions. The only other way it can breakout of SPECRec is if it meets an omitted element which signals the repetitions have ended.
If you do have an unknown number of these structures, then I would not use Group Indicators because these are used for structure identification and cannot control repetitions. I would consider used a Tagged Data Element separation to identify the structures and then use these to help the repetitions. However, you must also consider, whether you want the order of the input message maintained on the output message.
The first paragraph mentions why I believe your parsing is not successful for this bitstream. To further advise you I would need to understand a little more about your message structure, which is hard to determine from one example. Could you provide further details? Also you use have specified a delimiter of | in your message definition, but I dont see this in your sample message. Could you show a sample where this does appear in the message. _________________ Regards
Craig |
|
Back to top |
|
 |
asamanta |
Posted: Thu Aug 21, 2003 2:56 am Post subject: |
|
|
Novice
Joined: 20 Aug 2003 Posts: 18
|
Thanks Craig. Yes, both PRODRec & SPECRec, can repeat any number of times.
Using VLED with '|' was a desperate effort. With all the leaf level elements being fixed length, and knowing for sure that '|' won't occur as data, this really shouldn't have any erroneous effect - right!
I suppose you are suggesting Tagged Fixed Length as Data Element Seperation where Tag Length is 4 and the compund types have tags as 'PROD', 'SPEC'. Could you please let me know whether the above is correct and also elaborate the message structure.
Regards. |
|
Back to top |
|
 |
Craig B |
Posted: Thu Aug 21, 2003 3:04 am Post subject: |
|
|
Partisan
Joined: 18 Jun 2003 Posts: 316 Location: UK
|
Hi,
If you have specified a delimiter in a VLED environment but you have specified lengths on all your elements, then you are correct in that this will not be considered/used. From your confirmation that these structures can repeat any number of times, then the TDS modelling would lean more towards a Tagged Data element separation. When you use a fixed length repetitions or delimited repetitions with <LF> then these will continue to parse until maxOccurs, or in the latter case, when no <LF>s are detected. This would mean, that you are probably seeing that it never breaks out of the child structure where the parent also has <LF>
As for the model I would propose, this is dependent on whether your message needs to maintain a specific order of elements. When using Tagged repeating structures, these can be spread throughout your input message, but will be grouped together in the input tree as a repeating structure. This will give you an output message where they are all group together. If you are concernde about ordering of output fields, then this would mean that the tagged elements would not be repeating, but these would be embedded within a repeating parent type.
Could you let me know whether your fields need to maintain order on output? Or are you writing out a different formant output message? _________________ Regards
Craig |
|
Back to top |
|
 |
asamanta |
Posted: Thu Aug 21, 2003 3:35 am Post subject: |
|
|
Novice
Joined: 20 Aug 2003 Posts: 18
|
Craig, your questions are also enriching in that, they show choices about the possible routes to obtain a solution. Much obliged.
In the meantime the problem was successfully solved in the following manner
Code: |
MyMsg : CT, Ordered, VLED+Delim=<LF>
- HDRRec : CT, Ordered, FL
- DTLRec : CT, Ordered, TD+LOT=4+Delim=<LF>, {Repeat=Yes, RED=<LF>}
- PRODRec : CT, Ordered, FL, Tag=PROD
- SPECRec : CT, Ordered, FL, Tag=SPEC, {Repeat=Yes, RED=<LF>}
- TRLRRec : CT, Ordered, FL
Note: CT -> Compound Type, FL -> Fixed Length,
TD -> Tagged Delimited, LOT -> Length of Tag,
VLED -> Variable Length Elements Delimited,
RED -> Repeating Elements Delimiter |
Regards. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|