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 Model fixed length with last element varying length

Post new topic  Reply to topic
 TDS Model fixed length with last element varying length « View previous topic :: View next topic » 
Author Message
jbanoop
PostPosted: Tue Dec 12, 2006 4:08 am    Post subject: TDS Model fixed length with last element varying length Reply with quote

Chevalier

Joined: 17 Sep 2005
Posts: 401
Location: SC

Hi All,
I have a message format of the following format
AAAbbbCCCvvvvvv<LF>

Here AAA,bbb and CCC are fixed length components all having a fixed length of 3 characters but the vvvvvvv can have a variable length ranging from 0 to anything. That would also be the last element before the <LF>.
So some example messages would be..

AAAbbbCCC<LF>
AAAbbbCCCv<LF>

etc..

Any help would be greatly appriciated.
Regards,
Anoop
Back to top
View user's profile Send private message Yahoo Messenger
vk
PostPosted: Tue Dec 12, 2006 4:41 am    Post subject: Reply with quote

Partisan

Joined: 20 Sep 2005
Posts: 302
Location: Houston

You can define the following components in the message set -

Message_Type (Compound Type) - Data Element Separation = 'Use Data Pattern'

Record (Complex Element) - Data Pattern = '.{100}([^\n]*)\n', minOccurs = 1, maxOccurs = -1

Record_Type - Data Element Separation = 'Variabele Length Elements Delimited', Delimiter = '~' (Give a delimiter which will not be part of the data)

This type should have all the simple elements correcponding to AAA, bbb, CCC and vvvvvvv. Specify a length for all elements except the last one.

Regards,
VK.
Back to top
View user's profile Send private message
jbanoop
PostPosted: Tue Dec 12, 2006 5:21 am    Post subject: Reply with quote

Chevalier

Joined: 17 Sep 2005
Posts: 401
Location: SC

Hi VK,
thanks for the reply. Could you elaborate a bit more ?
By compound type do u mean complex type itself ?
Do yo mean to say

Msg_Type (Use data Pattern)
---- Record - Data Pattern -'.{100}([^\n]*)\n'
---- Record Type 'Variable Length Elements Delimited' delimiter ~
---- Record Type 'Variable Length Elements Delimited' delimiter ~
---- Record Type 'Variable Length Elements Delimited' delimiter ~


I am pretty confused, Would be gr8 if you could guide me a little bit more.
Regards,
Anoop
Back to top
View user's profile Send private message Yahoo Messenger
vk
PostPosted: Tue Dec 12, 2006 5:40 am    Post subject: Reply with quote

Partisan

Joined: 20 Sep 2005
Posts: 302
Location: Houston

Yes. Compound Type is same as Complex Type (In WMQI 2.1 it was called Compound Type)

Record is an element of type Record_Type. Record_Type will not repeat. Only elements can repeat. So the structure will be as follows -

Message ----- Message_Type (Use Data Pattern)
---------- Record [1] ----------- Record_Type (Variables Length Elements Delimited)
---------- Record [2] ----------- Record_Type (Variables Length Elements Delimited)
---------- Record [3] ----------- Record_Type (Variables Length Elements Delimited)
etc


Also in the data pattern which I mentioned, 100 is the length of the fixed part of the record, excluding the last element whose length can vary.

Regards
VK.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Dec 12, 2006 5:43 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Use <LF> as the delimiter. No reason to use "~" or anything that "won't appear in the message".
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
jbanoop
PostPosted: Tue Dec 12, 2006 6:06 am    Post subject: Reply with quote

Chevalier

Joined: 17 Sep 2005
Posts: 401
Location: SC

Hi Vk,
This is how i have defined the structure

Msg_Type - Use Data Pattern
----- RecElement (type = Rec_Type) minocc=1, MaxOcc=-1 pattern=
'. {11}([^\n]*)\n'

Rec_Type - Variable Elements Delimited
-E1 -size (6)
-E2 - size (5)
-E3 (size is not specified defaulting to 0)

I will test with it and get back, it would be helpful if you could re-confirm that this is actually what you have in mind.
Regards,
Anoop
Back to top
View user's profile Send private message Yahoo Messenger
kimbert
PostPosted: Tue Dec 12, 2006 2:46 pm    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

I try to avoid using Data Patterns - they tend to consume a lot of CPU. I don't think jbanoop's problem requires them.

Try this:
Code:

MessageType [Data Element Separation=All Elements Delimited, Delimiter='NOTUSED' Group Terminator=<LF>]
    LineType [Data Element Separation=VLED  (no delimiter required)]
        E1 [length=3]
        E2 [length=3]
        E3 [length=0]
LineType and MessageType are the complex types. Your message model will actually contain elements based on these types.
Back to top
View user's profile Send private message
jbanoop
PostPosted: Tue Dec 12, 2006 9:43 pm    Post subject: Reply with quote

Chevalier

Joined: 17 Sep 2005
Posts: 401
Location: SC

Vk,
I think your suggestion works, still not done exhaustive testing though.

Kimbert,
I tried out your suggestion and it works but there is a problem

for inputs such as
aaaBBBcccc<LF>
E1=aaa
E2=BBB
E3=ccc

or

aaaBBB<LF>
E1=aaa
E2=BBB

it works

however for an incorrect single line input like
aaaBB<LF>
(first two fields are mandatory and should be of length 3 each)
instead of throwing a parsing error, it gives
E1='aaa'
E2='BB\n'

My structure is
Msg_Type(AllElemDelimited)-(Delimeter=NOTUSED) group term = <LF>
---Recs (Type=Rec_Type) min occurs = 1 max occurs = -1

Rec_type (VLED) - Delimiter (#-not present in message)
-- E1 - 3
-- E2 - 3
-- E3 - 0

IS there anything I am doing wrong or missing .. any suggestions would be very helpful.
Regards,
Anoop
Back to top
View user's profile Send private message Yahoo Messenger
kimbert
PostPosted: Wed Dec 13, 2006 3:09 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Hi jbanoop,

- The parser is doing exactly what the model says ( and using a data pattern on the outer complex type would not make any difference ).
- How can the parser know whether the 6th character is supposed to belong to E2 or E3?
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 Model fixed length with last element varying length
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.