Author |
Message
|
pauln |
Posted: Fri Nov 02, 2012 12:33 pm Post subject: Fixed Lenght Message Set |
|
|
Newbie
Joined: 02 Nov 2012 Posts: 3
|
Hi,
I need to parse a message where all feilds are fixed but the last feild is vaiable length.
Message Example
AAABBBCCCDDD
Feild1 = AAA (3 Chars Fixed length)
Feild2 = BBB ( 3 Chars Fixed length)
Feild3 = CCC ( 3 Chars Fixed length)
Feild4 = DDD( Variable Chars length it may avry from 3 chars to 30 chars)
How do I define this find of message set.I tried defining fix length message set but it fails when the last field is less then 30 chars) as I defined the Feild4 as 30 chars(maximu chars).
Help would be higly appreciated.
Thanks
Paul |
|
Back to top |
|
 |
Vitor |
Posted: Fri Nov 02, 2012 12:38 pm Post subject: Re: Fixed Lenght Message Set |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
pauln wrote: |
How do I define this find of message set. |
You'd define this find of message set by setting Feild4 to be the length of the bitstream between the end of Feild3 and the end of the bitstream. It's a dropdown on the definition.
pauln wrote: |
Help would be higly appreciated. |
You'll find the InfoCenter a much faster source of assistance than posting for basic questions. Or even just experiementing. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
kimbert |
Posted: Fri Nov 02, 2012 2:30 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
If using v7 and the MRM parser, you can use Variable Length Elements Delimited on the complex type, and set the length to 0 on the final element.
If using DFDL ( v8 ) you can specify lengthKind='explicit' for the first three fields, and lengthKind='endOfParent' for the final field. |
|
Back to top |
|
 |
pauln |
Posted: Sat Nov 03, 2012 10:16 am Post subject: Thanks Kimbart |
|
|
Newbie
Joined: 02 Nov 2012 Posts: 3
|
Kimbart,
Thank you the soulution worked for me.
Regards,
Paul |
|
Back to top |
|
 |
pauln |
Posted: Sat Nov 03, 2012 10:27 am Post subject: For Vitor Need more info |
|
|
Newbie
Joined: 02 Nov 2012 Posts: 3
|
Hi Vitor,
Thank for your reply. I could not implement your suggestion. I am using WMB 7.01..Not sure of the solution you suggested is available in that version of WMB.
This is what I tried to do.
I created Message and Message defition.I defined a complex type with fixed length.Then I defined local element filed1 to field 3 fixed lenght assigned the leght but fouth field4 I could not find bitstream in the properties.Can you please give more details steps for creating the message set/def you suggested.
I could not find this "setting Feild4 to be the length of the bitstream between the end of Feild3 and the end of the bitstream. It's a dropdown on the definition."
"
Regards,
Paul
Thanks
Paul |
|
Back to top |
|
 |
Vitor |
Posted: Sat Nov 03, 2012 6:38 pm Post subject: Re: For Vitor Need more info |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
pauln wrote: |
Hi Vitor,
Thank for your reply. I could not implement your suggestion. I am using WMB 7.01..Not sure of the solution you suggested is available in that version of WMB. |
Yes it is; I have a message set in 7..0.3 currently which does this.
pauln wrote: |
I could not find bitstream in the properties.Can you please give more details steps for creating the message set/def you suggested.
I could not find this "setting Feild4 to be the length of the bitstream between the end of Feild3 and the end of the bitstream. It's a dropdown on the definition." |
I'm not really sure how much clearer I can be.
If @kimbert's equally valid solution is working for you, then go in peace and enjoy it. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
|