|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
TDS message set help |
« View previous topic :: View next topic » |
Author |
Message
|
Bravo |
Posted: Thu Oct 20, 2011 4:05 am Post subject: TDS message set help |
|
|
Centurion
Joined: 03 Oct 2005 Posts: 146
|
Hi All,
I have message set issue for the trailer record,
Message Definition
Code: |
Element Name='Message'
Local Complex Type DES=All Elements Delimited, Group Terminator=<CR><LF>, Delimiter=#
Element Name='Details'
Local complex type DES=Variable Length Elements Delimited, Delimiter=#
AccountField1 (Fixed length = 5)
Field2 (Fixed length = 2)
Field3 (Fixed length = 1)
Field4 (Fixed length = 2)
NameField5 (Variable length = 30) --> (firstname,lastname)
Element Name='Trailer'
Local complex type DES=Variable Length Elements Delimited, Delimiter=#
FillerField1 (Fixed length = 5)
AmountField2 (Fixed length = 5) |
Sample input
Code: |
0987612Y**Lee,Elizabeth<CR><LF>
0123416Y**Smith,John<CR><LF>
0678913Y**Lopez,Norma<CR><LF>
9999920345<CR><LF> |
Having problem with last record, I want to separate Detail record from trailer. Trailer record field FillerField1 will always filled with 9's
Any help! _________________ Bravo |
|
Back to top |
|
 |
Bravo |
Posted: Wed Oct 26, 2011 10:08 am Post subject: |
|
|
Centurion
Joined: 03 Oct 2005 Posts: 146
|
I am still looking for above solution, parsing each filed thru message set. For interim, I have created message set with CRLF as delimiter and separating(substring) the fileds in esql. I also tried Data pattern no luck. _________________ Bravo |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Oct 26, 2011 10:18 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
If the first record always starts with '09', or if the "non-trailer" records always start with something like '09', '01' and '06'... i.e. if each record is TAGGED at the front, you can use a Tagged, Delimited message set to match this.
You might otherwise be able to do some slightly tricky things with TDS choices, by ensuring that the trailer record is listed first in the choice and requires the full field length to be integer data. That might allow TDS to distinguish between the trailer and non-trailer records. |
|
Back to top |
|
 |
Bravo |
Posted: Wed Oct 26, 2011 11:26 am Post subject: |
|
|
Centurion
Joined: 03 Oct 2005 Posts: 146
|
Thank you Jeff for quick response.
First 5 bytes could be anything for detail records all numeric. But the trailer filled with all 99999 thats how trailer record is differentiated.So I cannot go with tag.
I am not sure with choices but let me go through the documentation _________________ Bravo |
|
Back to top |
|
 |
kimbert |
Posted: Wed Oct 26, 2011 11:37 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
Trailer record field FillerField1 will always filled with 9's |
That's useful. There is a modelling trick that should work for you.
You need to:
- Set the Repeating Element Delimiter of the Detail record to "<CR><LF>"
- Set the terminator of the complex type that contains the Detail records to "<CR><LF>99999". Like this:
Code: |
Element Name='Message'
Local Complex Type DES=All Elements Delimited, Delimiter="<CR><LF>99999"
Element Name='Details', minOccurs=0, maxOccurs=unbounded, Repeating Element Delimiter="<CR><LF>"
Local complex type DES=Variable Length Elements Delimited, Delimiter=""
AccountField1 (Fixed length = 5)
Field2 (Fixed length = 2)
Field3 (Fixed length = 1)
Field4 (Fixed length = 2)
Element Name='NameField5'
Local complex type DES=All Elements Delimited, Delimiter=","
firstName
lastName
Element Name='Trailer'
Local complex type DES=Fixed Length
AmountField2 (Fixed length = 5)
|
Note that I have split out the first name and last name for you - you don't have to do that, but I'm just showing you that it is possible to do it.
Note also that the filler field in the Trailer record has gone - that gets consumed as part of the delimiter between the repeating Detail records and the Trailer.
A couple of tips for you:
- Thanks for using code tags. Next time, please use indentation as well
- I have not tested this model. If it does not work first time, please take a debug-level user trace and *read it* before posting again. If you do post another question, please quote the full text of any error messages. |
|
Back to top |
|
 |
Bravo |
Posted: Wed Oct 26, 2011 3:37 pm Post subject: |
|
|
Centurion
Joined: 03 Oct 2005 Posts: 146
|
Perfect it works after little tweaking!!!!
Code: |
Element Name='Message'
Local Complex Type DES=All Elements Delimited, Delimiter="<CR><LF>99999"
Element Name='Details', minOccurs=0, maxOccurs=unbounded, Repeating Element Delimiter="<CR><LF>"
Local complex type DES=Variable Length Elements Delimited, Delimiter=""
AccountField1 (Fixed length = 5)
Field2 (Fixed length = 2)
Field3 (Fixed length = 1)
Field4 (Fixed length = 2)
Element Name='NameField5'
Local complex type DES=All Elements Delimited, Delimiter=","
firstName
lastName
Element Name='Trailer'
Local complex type DES=All Elements Delimited, Delimiter="", Group terminator="<CR><LF>"
AmountField2 (Fixed length = 5)
|
Thanks kimbert for your time!! _________________ Bravo |
|
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
|
|
|
|