|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
COPYING ELEMENTS FROM THE LIST |
« View previous topic :: View next topic » |
Author |
Message
|
mpong |
Posted: Mon Mar 10, 2014 7:41 am Post subject: COPYING ELEMENTS FROM THE LIST |
|
|
Disciple
Joined: 22 Jan 2010 Posts: 164
|
Dear All,
My requirement is to fetch particular element in a list to create a new output root and propagate to other queue.
a) I use CARDINALITY function to determine the number of elements in the list
count INT CARDINALITY(InputRoot.MRM.LIST_MSG[]);
lets say it returns 6 and I want to fetch 5th element then I do count=count-1;
b) DECLARE MsgText BLOB
CAST(ASBITSTREAM (InputRoot.MRM.LIST_MSG[count] OPTIONS parseOptions SET 'AAA' TYPE 'BBB' FORMAT 'CCC')AS BLOB);
c)CREATE LASTCHILD OF OutputRoot DOMAIN('MRM')
PARSE(MsgText ,inEncoding,inCCSID,'AAA','BBB','CCC',parseOptions);
After b executes it returns all elements in the list(MsgText), I am unable to get that particular element, Please help me to figure out my mistake.
Thanks. |
|
Back to top |
|
 |
Vitor |
Posted: Mon Mar 10, 2014 8:39 am Post subject: Re: COPYING ELEMENTS FROM THE LIST |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
mpong wrote: |
Please help me to figure out my mistake. |
Can you explain a bit more why you're doing it this way? I would have thought something like this untested example would do you:
Code: |
CREATE LASTCHILD OF OutputRoot.MRM FROM InputRoot.MRM.LIST_MSG[count] |
_________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
mpong |
Posted: Tue Mar 11, 2014 2:40 am Post subject: |
|
|
Disciple
Joined: 22 Jan 2010 Posts: 164
|
Hello Vitor, Thanks for the response.
This is for the new change from the source side where they may not publish certain things for particular element, on such cases we would want to filter that particular element and store it in DB for reference usage also want to have it in holding queue for some period.
I have achieved getting particular element and putting it as separate msg.
Thanks. |
|
Back to top |
|
 |
mpong |
Posted: Tue Mar 11, 2014 5:08 am Post subject: |
|
|
Disciple
Joined: 22 Jan 2010 Posts: 164
|
Hi Vitor, When I save new msg and open it in text pad it is always in the second line, it is prefixed with CRLF, there is no change in the headers. OutputRoot.MRM.LIST_MSG looks fine on debug mode but when it hits the queue it has the new line prefixed with, any inputs on this?
My input msg set has repeating element delimiter as <CR><LF>, can this cause an issue? |
|
Back to top |
|
 |
Vitor |
Posted: Tue Mar 11, 2014 5:58 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
mpong wrote: |
My input msg set has repeating element delimiter as <CR><LF>, can this cause an issue? |
 _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
mpong |
Posted: Wed Mar 12, 2014 4:19 am Post subject: |
|
|
Disciple
Joined: 22 Jan 2010 Posts: 164
|
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|