ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » TDS fixed length elements

Post new topic  Reply to topic
 TDS fixed length elements « View previous topic :: View next topic » 
Author Message
Madhulika
PostPosted: Mon May 30, 2005 4:05 am    Post subject: TDS fixed length elements Reply with quote

Newbie

Joined: 10 Jan 2005
Posts: 2

Hi,

I have a flow which is to build a message of the following format:

element1element2element3[element11element12element21element22.......]

for this, I have defined a TDS message set, of Fixed Length format.
In this I have a compound element, also of fixed length format, which has 2 simple string elements as child elements. The compound element can repeat 1-100 times. The compound element has been defined in a sequence which can repeat only once, with group delimiter set to '[' and group terminator set to ']'.

My problem is when there are less than 100 occurrences, I do not want the rest of the elements to appear, even as nulls. Right now I get the remaining values set to the value i set in the default parameter of the element.
For example when there are just 3 occurrences of the repeating element, I want my message to look like:

element1element2element3[element11element12element21element22element31element32]

and not

element1element2element3[element11element12element21element22element31element32null null null ......... ]

How can I model my message to do this?

Any ideas would be appreciated.

Thanks and regards,
Madhulika.
Back to top
View user's profile Send private message
kimbert
PostPosted: Tue May 31, 2005 12:54 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Which version and CSD levels are you using?
Back to top
View user's profile Send private message
madhulika_desai
PostPosted: Tue May 31, 2005 4:33 am    Post subject: Reply with quote

Newbie

Joined: 19 May 2005
Posts: 9

Hi Kimbert,

Thanks for replying.

I am using version 5, CSD 4.

I have come up with a solution, do tell me if there is a better way of achieving the same.
I have created a compound element, CompoundElement1, of type DataPattern. Within this is another compund element, Compound Element2, of fixed length type, with the Data Pattern field set to [\[\]]* (which basically stands for a string containing any character but '[' and ']')
Within CompoundElement2 I have 2 simple type string elements with length fields set appropriately. CompoundElement2 has minOccurs set to 1 and maxOccurs set to 100. But since its parent element, CompoundElement1, is not FixedLength type, the null elements (i.e. the remaining occurrences) are not created.
I have created 2 simple elements, one before and the other after CompundElement2, to hold '[', and ']', which I set in the flow.
I have tested this message set and its working fine, but I would definitely like to know if this is the only way to go about the problem or if there is a better way.
Any ideas are welcome!!

Thanks and regards,
Madhulika.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue May 31, 2005 4:50 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

There are other ways to do this. Better is a more difficult question - better in what way? Easier to understand? More closely aligned to the business meaning of the data? Faster to process? More flexible for future use?

The reason your data pattern works and your other tds model didn't work is the change in Data Element Separation for your parent node
Quote:
But since its parent element, CompoundElement1, is not FixedLength type


I would have built your model as something like
Code:
Msg
    Element 1
    Element 2
    Element 3
    ElementGroup(Tagged-Delimited, tag [, group delimiter ],1 to 100)
       Element4

Or with more elements in ElementGroup predefined, depending on the nature of the data.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » TDS fixed length elements
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.