Author |
Message
|
vennela |
Posted: Tue Nov 16, 2004 8:33 am Post subject: duplicate elements in compound message |
|
|
 Jedi Knight
Joined: 11 Aug 2002 Posts: 4055 Location: Hyderabad, India
|
Posting this on behalf of somebody.
I have a doubt regarding usage of a message set.
I have a message set and created some elements like A,B,C.
I created a compound message type with Type composition'sequence' and Typecontent 'closed'.
this was done to duplicate elements.
In the Compound message type , i have A,B,C,A .
Now in the esql code , i want to assign different values for A like
set A= 10
set B =5
set C=13
set A=20
My problem is The first set A=10 is being replaced by the last set A.
Is there any way in which i can preserve the structure of the message with different values?
I checked in the esql reference manual(chap 5 , page 115 ) for type composition sequence . it said that
the first set assigns first element and second set to second.is this related to the above problem?.IF so it should not replace the first item right? |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Nov 16, 2004 8:36 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
The first occurance of an element named A will be addressed by the syntax A[1].
The second will be addressed by A[2]. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
Pavan |
Posted: Tue Nov 16, 2004 10:49 am Post subject: |
|
|
Newbie
Joined: 16 Oct 2004 Posts: 3
|
Can this syntax also be used for duplicate elements ?
As it is given that this syntax is for repeating elements. |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Nov 16, 2004 10:54 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Pavan wrote: |
Can this syntax also be used for duplicate elements ?
As it is given that this syntax is for repeating elements. |
Please explain to me the difference between one type of element that occurs more than once and the other type of element that occurs more than once. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
Pavan |
Posted: Tue Nov 16, 2004 11:13 am Post subject: |
|
|
Newbie
Joined: 16 Oct 2004 Posts: 3
|
Referring the manual , ""Repeated elements are always contiguous and are specified in the form A[n]. ""
where as duplicate elements need not be contiguous.
Is the syntax same for specifying the non-contigous elements? |
|
Back to top |
|
 |
kirani |
Posted: Tue Nov 16, 2004 11:18 am Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
Repeated Elements: A repeated element is an element that is included once within the compound type, and is defined with the property Repeat set to Yes (on the Connection pane). Repeated elements are therefore always contiguous and are always specified in the form A[n].
Duplicate Elements: A duplicate element is an element included more than once anywhere within the compound type. Duplicate elements do not have to be contiguous. _________________ Kiran
IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries
|
|
Back to top |
|
 |
Pavan |
Posted: Tue Nov 16, 2004 11:41 am Post subject: |
|
|
Newbie
Joined: 16 Oct 2004 Posts: 3
|
So how can the non-contiguous elements that are duplicated in a compound type be specified different values? |
|
Back to top |
|
 |
kirani |
Posted: Tue Nov 16, 2004 11:59 am Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
You will still use ArrayIndex type reference to refer to these duplicate elements (as explained by Jeff). For example, OutputRoot.MRM.A[1] will refer to first element, and OutputRoot.MRM.A[2] will refer to second element and so on ..
BTW this is all documented in Working With Messages manual. _________________ Kiran
IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries
|
|
Back to top |
|
 |
|