Author |
Message
|
RB |
Posted: Fri Jun 22, 2007 7:39 am Post subject: Repeat reference and TDS |
|
|
Acolyte
Joined: 23 May 2006 Posts: 56
|
Hi All,
I am trying to define a message structure with multipe repeating structures using TDS structure. I am trying to get the structure given below.
Code: |
- Filler1
- CountGrp1
- Group1 (Repeating based on CountGrp1)
- Memb1
- Memb2
-Filler2
-CountGrp2
-Group2 (Repeating based on CountGrp2)
- Memb3
- Memb4
-Filler3
|
I am using using length referenct field for Group1 and Group2 to refer to CountGrp1 and CountGrp2 respectively. And I am using an all elements delimited structure with '~' as the delimiter for all the elements.
Though I specify the count of repetition, it is not taking that. It is always trying to fit the fill structure in Group1 itself as if the repeat referenct is not specified at all (the maxoccurs for Group1 is defined as -1 and the delimiter is the same)
Can anyone please let me know why the length reference is not overriding the maxoccurs? Is there any other setting to be done to get it effective?
Regards,
RB |
|
Back to top |
|
 |
kimbert |
Posted: Fri Jun 22, 2007 4:29 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
I am using using length referenct field for Group1 and Group2 to refer to CountGrp1 and CountGrp2 respectively |
You cannot use Length Reference to specify a Repeat Reference. TDS does not have 'Repeat reference' ( but the WMB development team view it as a high-priority requirement ).
It looks as if the input message comes from COBOL, so CWF would be the natural way to do this ( and then you can just import the copybook to create the message definition). Is there a reason why you decided to use TDS? |
|
Back to top |
|
 |
RB |
Posted: Fri Jun 22, 2007 7:27 pm Post subject: |
|
|
Acolyte
Joined: 23 May 2006 Posts: 56
|
Thanks Kimbert for your reply.
Quote: |
TDS does not have 'Repeat reference' ( but the WMB development team view it as a high-priority requirement ). |
So does this mean that MB doesn't support multiple repeating segments for delimited structures?
Actually my input is not from COBOL, but one of the older VB versions and they prefer to send it using delimited format. I thought TDS is the only way to address this. Is it possible to model using some other formats?
Regards,
RB |
|
Back to top |
|
 |
smdavies99 |
Posted: Fri Jun 22, 2007 9:47 pm Post subject: Model Message in CWF |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
Then add the TDS Physical Format.
From the sample of your message strucure you have given, it looks like a classic Cobol Copybook format. If you can describe your message in this way then you can import the copybook and model it as a CWF Physical Format. Then you can add the TDS physical format and setup the delimiters as appropriate.
(This is my guess as to what Kimbert was implying)
Remember with the MRM message model you can have multiple physical formats to the message. (CWF, TDS, XML)
/S _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
kimbert |
Posted: Sat Jun 23, 2007 12:02 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
smdavies said:
Quote: |
Remember with the MRM message model you can have multiple physical formats to the message |
Not in the way that you are implying, though. RB cannot use CWF and TDS to parse different parts of the same message. ( not automatically, anyway. But CWF could deal with the outer structure with its repeat refs, and RB could use CREATE...PARSE in a Compute node to parse the inner structures using TDS ).
RB : Apologies for missing the issue re: the delimiters. You are correct in saying that CWF cannot deal with delimited formats. |
|
Back to top |
|
 |
RB |
Posted: Sun Jun 24, 2007 7:08 am Post subject: |
|
|
Acolyte
Joined: 23 May 2006 Posts: 56
|
Thanks guys for your reply.
I have some doubts about multiple physical formats. I have never tried that in the past. Both inner and outer structures are delimited and the delimiter is same as well. So will I be able to model the outer structure using CWF (it is again delimited)!!
Regards,
RB |
|
Back to top |
|
 |
RB |
Posted: Sun Jun 24, 2007 9:59 am Post subject: |
|
|
Acolyte
Joined: 23 May 2006 Posts: 56
|
I tried couple of options, but nothing seems to work. Is there any reference for multiple physical formats in MRM? I couldn't find anything in manuals or redbooks!!
Quote: |
RB cannot use CWF and TDS to parse different parts of the same message. ( not automatically, anyway. But CWF could deal with the outer structure with its repeat refs, and RB could use CREATE...PARSE in a Compute node to parse the inner structures using TDS ).
|
I think I may not be able to use CWF to parse one section and TDS to parse some other. Because the message is pure delimited (all sections) and we are trying to add CWF just to obtain the repeating reference property for some segments. So it's like a combination of CWF and TDS for the entire message. I could be wrong; I am ignorant about using multiple physical formats in the same message. Please let me know your thoughts.
Regards,
RB |
|
Back to top |
|
 |
kimbert |
Posted: Sun Jun 24, 2007 1:29 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
These parsing issues always come down to the specific details of the problem, so let's get the facts into the open. Please post the following:
1. one or more example messages. Please make sure you suppy enough examples/explanation to highlight all of your parsing requirements.
2. the message tree which you want to obtain for each example message. |
|
Back to top |
|
 |
RB |
Posted: Sun Jun 24, 2007 6:07 pm Post subject: |
|
|
Acolyte
Joined: 23 May 2006 Posts: 56
|
My actual structure is really complicated with more than 10 repeating segments. For the structure I have given in the example the details are given below.
Sample input message (With repeating count as 2 for both the repeating segments) .
Code: |
fil1~2~memb1~memb2~memb11~memb22~fil2~2~memb3~memb4~memb33~memb44~fill3 |
And the output I am expecting is something like this.
Code: |
(0x01000021):MRM = (
(0x0300000B):Filler1 = 'fil1'
(0x0300000B):CountGrp1 = 2
(0x01000013):Group1 = (
(0x0300000B):Memb1 = 'memb1'
(0x0300000B):Memb2 = 'memb2'
)
(0x01000013):Group1 = (
(0x0300000B):Memb1 = 'memb11'
(0x0300000B):Memb2 = 'memb22'
)
(0x0300000B):Filler2 = 'fil2'
(0x0300000B):CountGrp2 = '2'
(0x01000013):Group2 = (
(0x0300000B):Memb3 = 'memb3'
(0x0300000B):Memb4 = 'memb4'
)
(0x01000013):Group2 = (
(0x0300000B):Memb3 = 'memb33'
(0x0300000B):Memb4 = 'memb44'
)
(0x0300000B):Filler3 = 'fil3'
) |
Regards,
RB |
|
Back to top |
|
 |
kimbert |
Posted: Mon Jun 25, 2007 3:39 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
There is no simple answer here - you really need repeat reference for this. I expect it is possible to work around it, if you are prepared to spend the time. Here are a couple of ideas to investigate:
a) use the string '~fil' as the Repeating Element Delimiter of the enclosing structure. Add a dummy element to the start of each repeating group to consume the repeat count. This requires that your filler fields have a fixed string ( they do in your example ).
b) Set Data Element Separation to 'Use Data Pattern' and try something similar. Same requirement re: filler fields.
If your filler fields do not contain recognisable data then your message is not parseable without Repeat Reference support. |
|
Back to top |
|
 |
RB |
Posted: Mon Jun 25, 2007 4:54 pm Post subject: |
|
|
Acolyte
Joined: 23 May 2006 Posts: 56
|
Thanks Kimbert for your help.
I can't use data pattern in this case. My actual structure is really complicated with more than 10 repeating segments and I may not be able to come up with a pattern in each case.
I am trying to get the application team use fixed width format instead of delimited, so that I can use CWF and model using repeat reference.
Regards,
RB |
|
Back to top |
|
 |
jefflowrey |
Posted: Mon Jun 25, 2007 6:34 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
If they can even add a unique group delimiter to each repeating section, you might be able to do this with TDS... _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
kimbert |
Posted: Tue Jun 26, 2007 2:12 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Delimited is usually neater than fixed-length because you don't waste loads of space on padding. If you can influence the format then you should stay with a delimited structure but do one of the following:
a) use a different the delimiter for each level ( and remove the repeat count which will be redundant ).
b) put tags on the groups |
|
Back to top |
|
 |
|