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 » [URGENT] TDS message model

Post new topic  Reply to topic Goto page 1, 2  Next
 [URGENT] TDS message model « View previous topic :: View next topic » 
Author Message
leo.yue
PostPosted: Mon Apr 10, 2006 4:00 pm    Post subject: [URGENT] TDS message model Reply with quote

Acolyte

Joined: 20 Oct 2004
Posts: 52

There is a message.

Quote:
<CR><LF>A1 C1234 D1234 F1234
<CR><LF>


A1 is optional and it must start with 'A' or be 'ZZ'. 'C1234', 'D1234', 'F1234' are fixed length (5). These element are divided by space.

How can I do it? I have no sense about how to set 'A1' optional, maybe using regular expression.

really appreciate any help
Back to top
View user's profile Send private message
vinbud117
PostPosted: Mon Apr 10, 2006 7:26 pm    Post subject: Reply with quote

Acolyte

Joined: 22 Jul 2005
Posts: 61

handle that in BLOB, ie before parsing... just check if the first two char is A1 in the filter node and then send it to the RCD... u can even have two diff message types, one with element for handling A1 and the other without that element...
Back to top
View user's profile Send private message
elvis_gn
PostPosted: Mon Apr 10, 2006 7:33 pm    Post subject: Reply with quote

Padawan

Joined: 08 Oct 2004
Posts: 1905
Location: Dubai

Hi leo.yue,

If you have the time you should try out the choice in message sets.

Define groups with A1 or ZZ as the tags to the group

So if it finds A1 it will follow that structure or if its ZZ u can define another structure,....since for you the structures are same, just use choice for the simple fields A1 or ZZ....

Note: I only know this is concept, not sure if it works or how it works Thats why I said, "if you have the time".

Regards.
Back to top
View user's profile Send private message Send e-mail
kimbert
PostPosted: Tue Apr 11, 2006 12:23 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

You can probably do this using the TDS parser without needing to use the BLOB domain at all. But your description of the message is incomplete:
Quote:
A1 is optional and it must start with 'A' or be 'ZZ'. 'C1234', 'D1234', 'F1234' are fixed length (5)

- is the 'A1' a tag for the fixed-length fields which follow, or is it part of the data?
- is it always 2 characters ( 'A2', 'AZ' etc ) or can its length vary?
- if the 'A1' is a 2-character tag, what are the other possibilities?
Back to top
View user's profile Send private message
leo.yue
PostPosted: Tue Apr 11, 2006 5:13 am    Post subject: Reply with quote

Acolyte

Joined: 20 Oct 2004
Posts: 52

thanks all.

Quote:
- is the 'A1' a tag for the fixed-length fields which follow, or is it part of the data?


'A1' is the part of the data

Quote:
- is it always 2 characters ( 'A2', 'AZ' etc ) or can its length vary?


its length range is 1 to 3

Quote:
- if the 'A1' is a 2-character tag, what are the other possibilities?


no, 'A1' is not a tag

Thanks kimbert.
Back to top
View user's profile Send private message
dsriksha
PostPosted: Tue Apr 11, 2006 5:45 am    Post subject: Reply with quote

Voyager

Joined: 27 Feb 2005
Posts: 95

I am still not that sharp in underastanding others message formats . But this may work.

Quote:
<CR><LF>A1 C1234 D1234 F1234
<CR><LF>


create 4 localelements say A, C, D, F

In localelemnt A create a choice element, then in choice element create a1, z1 local elements.
Back to top
View user's profile Send private message Send e-mail
granthmuk
PostPosted: Tue Apr 11, 2006 7:13 am    Post subject: Reply with quote

Apprentice

Joined: 16 May 2001
Posts: 38
Location: Edinburgh, Scotland

It may be worth looking at Regular Expressions to parse your message.
Do a search for
Quote:
Regular Expressions
in your toolkit help.
Back to top
View user's profile Send private message
juddg
PostPosted: Tue Apr 11, 2006 8:05 am    Post subject: Try the following Reply with quote

Apprentice

Joined: 22 Nov 2004
Posts: 33

Hi,
Try the following definition for a row.

Code:

Sequence
Data Element Separation - Use Data Pattern
   |
   |
   -- Sequence
   |   minOccurs - 0
   |   Data Element Separation - Use Data Pattern
   |   Data Pattern - (((A[^&#x20;]{0,2})|ZZ)&#x20;)
   |   Group Terminator - <SP>
   |      |
   |      |
   |      -- Element Name - Elem1
   |          Data Pattern - [^&#x20;]*
   |
   |
   -- Sequence   
       Data Element Separation - All Element Delimited
       Data Pattern - .*
       Delimiter - <SP>
         |
         |
         -- Element Name - Elem2
         |
         -- Element Name - Elem3
         |
         -- Element Name - Elem4


Regards,

juddg.
Back to top
View user's profile Send private message
elvis_gn
PostPosted: Tue Apr 11, 2006 7:45 pm    Post subject: Reply with quote

Padawan

Joined: 08 Oct 2004
Posts: 1905
Location: Dubai

Hi leo.yue,

If you know that spaces are always available, then use it as the delimiter.....U can use the first field as the Tag or as a field itself....Your ESQL might vary accordingly....you will have to forsee that.

There are many ways of doing it....

Hence I suggest you try them all and see which works.

Regards.


Last edited by elvis_gn on Mon Apr 17, 2006 1:45 am; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail
leo.yue
PostPosted: Wed Apr 12, 2006 7:23 am    Post subject: Reply with quote

Acolyte

Joined: 20 Oct 2004
Posts: 52

thanks for your reply.

juddg, I just tired your suggestion based on the following message.

Quote:
<CR><LF>01 A1 C1234 D1234 F1234
<CR><LF>02
A1 is optional


I changed your definition as follows (added 'Group Indicator - <CR><LF>01' in the sequence):

Code:

Sequence
Data Element Separation - Use Data Pattern
   -- Sequence
       minOccurs - 0
       Data Element Separation - Use Data Pattern
       Data Pattern - (((A[^&#x20;]{0,2})|ZZ)&#x20;)
       Group Indicator - <CR><LF>01
       Group Terminator - <SP>
           -- Element Name - Elem1
               Data Pattern - [^&#x20;]*
   -- Sequence   
       Data Element Separation - All Element Delimited
       Data Pattern - .*
       Delimiter - <SP>
         -- Element Name - Elem2
         -- Element Name - Elem3
         -- Element Name - Elem4


Then, MRM paser generated an Error.
Back to top
View user's profile Send private message
juddg
PostPosted: Wed Apr 12, 2006 8:45 am    Post subject: Reply with quote

Apprentice

Joined: 22 Nov 2004
Posts: 33

Hi,
If I understand this format correctly <CR><LF>01<SP> will always appear at the beginning of the line but the A1 part is optional. In which case I suggest you try removing the Group Indicator from the inner sequence and put the Group Indicator <CR><LF>01<SP> on the outer sequence.

Regards,

juddg.
Back to top
View user's profile Send private message
leo.yue
PostPosted: Wed Apr 12, 2006 5:24 pm    Post subject: Reply with quote

Acolyte

Joined: 20 Oct 2004
Posts: 52

juddg, got it. Thanks.

If there is not <sp> between <CR><LF>01 and A1, just like:

Quote:
<CR><LF>01A1 C1234 D1234 F1234
<CR><LF>02
A1 is optional


Can I put <CR><LF>01 at the Group Indicator in the inner sequence? I tried it, but it does not work.
Back to top
View user's profile Send private message
juddg
PostPosted: Thu Apr 13, 2006 1:01 am    Post subject: Reply with quote

Apprentice

Joined: 22 Nov 2004
Posts: 33

Hi,
Whether there is a space after the <CR><LF>01 is not the issue. The first inner sequence is intended to consume just the optional A1 element followed by the space. That is what the regular expression (((A[^&#x20;]{0,2})|ZZ)&#x20;) does. If you want this sequence to have a Group Indicator of <CR><LF>01 you will need to modify the regular expression to match the <CR><LF>01. For instance (\r\n01((A[^&#x20;]{0,2})|ZZ)&#x20;). However this will only work correctly if the <CR><LF>01 is optional along with the A1 which I think is probably not the case. Am I right in thinking that if the A1 element is missing the line will look like?

Quote:

<CR><LF>01C1234 D1234 F1234


If this is the case and you have the Group Indicator on the inner sequence you would need to modify the data pattern on the inner sequence to be (\r\n01(((A[^&#x20;]{0,2})|ZZ)&#x20;)?) so that it will match <CR><LF>01A1 or just <CR><LF>01 if A1 is missing. You should also set the minOccurs of the inner sequence to 1. Then you should change the minOccurs of Elem1 to be 0 and its data pattern to be [^&#x20;]+. So if A1 is missing the inner sequence data pattern will match <CR><LF>01. This will then be treated as the Group Indicator of the sequence and as there is no data left the data pattern on Elem1 will not match so it will be handled as missing.

I hope this helps,

Regards,

juddg.
Back to top
View user's profile Send private message
leo.yue
PostPosted: Thu Apr 13, 2006 3:56 am    Post subject: Reply with quote

Acolyte

Joined: 20 Oct 2004
Posts: 52

juddg, you are so cool.

But I tried the following message

Quote:
<CR><LF>01C1234 D1234
<CR><LF>F1234


MRM can not work normally (certainly, I have changed the message definition accordingly). I tried to update the regular expression, but...
Back to top
View user's profile Send private message
juddg
PostPosted: Thu Apr 13, 2006 4:26 am    Post subject: Reply with quote

Apprentice

Joined: 22 Nov 2004
Posts: 33

Hi,
Although I am happy to help you, each time I provide a suggestion you change the scenario slightly. Do you have a complete description of what you are attempting to model? In the latest scenarion the last element has been delimited by a <CR><LF> not <SP> which has caused the parse to fail. In the following post:

http://www.mqseries.net/phpBB2/viewtopic.php?t=28403

I provided you with an example of how to parse elements that maybe delimited by <SP> or <CR><LF>.

Regards,

juddg.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » [URGENT] TDS message model
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.