|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
TDS - CSV Design Question |
« View previous topic :: View next topic » |
Author |
Message
|
vk |
Posted: Tue Dec 05, 2006 2:26 pm Post subject: TDS - CSV Design Question |
|
|
Partisan
Joined: 20 Sep 2005 Posts: 302 Location: Houston
|
I have an interface where input message is TDS-Fixed With and output is TDS-CSV. Output message has a lot of String fields and the requirement is to enclose all of them in double quotes. But numeric fields should be left as such. I tried the following options to achive this -
1. Manually append double quotes before and after the field value in ESQL. This works fine.
2. Define a wrapper type for each String element. The properties of the type are Data Element Separation = All Elements Delimited, Group Indicator = ", Group Terminator = ". This also works fine.
But I dont think this is a good design if the number of String elements in the message is more. Is there anyway to make the MRM parser automatically add double quotes to all String elements?
If all fields in the message are Strings, then we can define the type as Data Element Separation = (All Elements Delimited), Delimiter = (","), Group Indicator = (") and Group Terminator = ("). But this cannot be used when there are numeric fields in the message.
Thanks in advance,
VK. |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Dec 05, 2006 2:27 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
There is a CSV sample in the Samples gallery. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
vk |
Posted: Tue Dec 05, 2006 8:34 pm Post subject: |
|
|
Partisan
Joined: 20 Sep 2005 Posts: 302 Location: Houston
|
Thanks Jeff.
I went through the message set sample available in the samples gallery. Two design options given there are same as the ones I mentioned in my initial post. The thrid one expects the double quotes to be present in the input message, which will not be the case for me.
For now, I will go with the options 1 or 2 which I already tried out. I will also think of some other easier way for achieving the same. Please let me know if you can think of any other option.
Thanks,
VK. |
|
Back to top |
|
 |
kimbert |
Posted: Wed Dec 06, 2006 3:48 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Hi vk,
Option 2 is the best option in v6.0. However, you are correct to point out that this is rather cumbersome. It would be ideal if you could define a String type which had a Group Indicator and Group Terminator. Unfortunately, GI/GT only apply to complex types and groups.
However...you could try this if you're feeling brave:
- Define a new complex type 'QuotedString'
- Set its 'Base Type' property to 'xs:string'.
- Set its Group Indicator and Group Terminator to "
- Change all uses of xs:string to QuotedString.
I have not tested this, but in theory it ought to work. |
|
Back to top |
|
 |
vk |
Posted: Thu Dec 07, 2006 4:41 pm Post subject: |
|
|
Partisan
Joined: 20 Sep 2005 Posts: 302 Location: Houston
|
Thanks kimbert. This works. I tried in WMQI 2.1 and WMB v6.0. it is working in both.
Regards,
VK. |
|
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
|
|
|
|