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 Repeating Element Only Repeating Once

Post new topic  Reply to topic
 TDS Repeating Element Only Repeating Once « View previous topic :: View next topic » 
Author Message
sboucher
PostPosted: Wed Oct 29, 2003 9:02 am    Post subject: TDS Repeating Element Only Repeating Once Reply with quote

Acolyte

Joined: 27 Oct 2002
Posts: 52

I have defined the following logical model with a TDS physical layer that parses based on pattern matching but repeating elements only happen once

LOGICAL MODEL
CODE LENGTH 6 STRING
QTY LENGTH 6 STRING

TDS PHYSICAL LAYER
CODE Repeating Min Occurs 1; Max Occurs Left Blank (Unknown)
Pattern: [0-9]{6}
QTY Repeating Min Occurs 1; Max Occurs Left Blank (Unknown)
Pattern: [0-9]{6}

MESSAGE STREAM

123456000058654321000009:

Note: The colon signifies the end of message and will be part of
the message. My thoughts were the colon can signify the
end of repeating elements

MESSAGE FLOW PROPERTIES

Input Node Domain is set to MRM

I use a compute node to convert to XML as follows.
SET OutputRoot.XML."MSG"."CODE" = InputRoot.MRM."CODE";
SET OutputRoot.XML."MSG"."QTY" = InputRoot.MRM."QTY";
SET OutputRoot.MQMD.Format = 'XML ';

I'm stumped and looking for some assistance

Thanks
_________________
Scott A. Boucher
Database Administartor
Back to top
View user's profile Send private message Send e-mail
Yuvaraj
PostPosted: Wed Oct 29, 2003 9:27 am    Post subject: Reply with quote

Apprentice

Joined: 28 Oct 2003
Posts: 30

Hi

Could you also tell whats the output you are getting?

In the case of repeating elements with unknown Max occurs, there must be a breaking condition for the parser to know that the repetition for this field as end and the next field is starting. Though your message has the ':', it just indicates the end of the message and not for the field/element level.

As per the data pattern you have given i.e. [0-9]{6}, the parser will be getting 6 bytes of input data and map onto the first field. Since this field is repeating, the parser will continute to pick the next field and map on to the same field and so on. Until it comes across the breaking condition indicating to the parser that this field has come to an end. Which doesn't seem to happen as per your data pattern and the message.

I think if you can give the output you are getting, it will be more helpful.

Thanks & Regards
Yuvaraj
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Wed Oct 29, 2003 10:03 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

What Yuvaraj said is correct. There's no way with your current model for the parser to know when to stop taking CODE elements and start taking QTY elements. You are telling the parser that your data looks like {CODE}{CODE}....{QTY}{QTY}..... So it needs to know (by a delimiter) when to stop grabbing CODE elements and switch to grabbing QTY elements.

If your data is actually {CODE}{QTY}{CODE}{QTY}.... instead of {CODE}{CODE}....{QTY}{QTY}.... then that is a different logical structure, and can be handled without adding any additional delimiters.

For that you need to create an enclosing Compound type that is a Fixed Lenght type that contains the CODE and QTY elements. Then create an element of that fixed type in your Message, and set the unknown maximum repeat on the compound element, with the terminating : modeled.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
sboucher
PostPosted: Wed Oct 29, 2003 12:41 pm    Post subject: Reply with quote

Acolyte

Joined: 27 Oct 2002
Posts: 52

Jeff,

I want to model {Code}{Qty}{Code}{Qty} as you have suggested in your reply.

Can you please take me through the logical modeling and bear with me as this is all new to me and no training in sight:

This is what I did after reading your post (Starting from scratch) to create the new logical model:

1. Created New Message Set
2. Righ Clicked Type..Use Smart Guide to Create Compund Type
3. Named Type REPEAT_T
4. Created elements with smart guide:CODE Len 6 QTY Len6
5. Set Repeating to Yes Min Occurs 1; Max Occurs Blank for both
CODE and QTY
6 Type Composition: Ordered Set; Type Content Closed
7. Created Message based on Type REPEAT_T

I'm unsure whether I created the compund type correctly. You mentioned to create a Fixed Length Type. Didn't see where there was a choice for this or might this be part of the TDS Physical layer. Also will I still be doing pattern matching with the Group Terminator set to :

Thanks so much for your reply. I really would approciate someone walking me through this

Thanks
_________________
Scott A. Boucher
Database Administartor
Back to top
View user's profile Send private message Send e-mail
jefflowrey
PostPosted: Wed Oct 29, 2003 12:49 pm    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

What you want is a message tree like this:
  • Message
    • Group
      • Code
      • Qty


You will set the Repeat only on the Group element above, not on the individual code and quantity elements. This is because what you've got is exactly a repeating group of elements, not a group of repeating elements.

If you're using data patterns, which you are, then you can ignore what I said about fixed length (and I should have ignored it myself) and terminators. Use the patterns to indicate the size and type and the terminator and etc of your elements as you already are.

Basically, just take what you've got, add a Group (or whatever you want to call it) compound type and element, and then change where the repeats are specified.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
sboucher
PostPosted: Wed Oct 29, 2003 3:43 pm    Post subject: Reply with quote

Acolyte

Joined: 27 Oct 2002
Posts: 52

Jeff,

Didn't I create a group when I used the smart guide for creating REPEAT_T.

I only see the connection tab on the individual elements (CODE QTY) within REPEAT_T and not on REPEAT_T itself.

Can you be very specific, this is soooo frustrating for me.

Thanks
_________________
Scott A. Boucher
Database Administartor
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » TDS Repeating Element Only Repeating Once
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.