Author |
Message
|
kakkarj |
Posted: Mon Aug 03, 2009 2:00 pm Post subject: Message Broker Extracting tree as CHAR |
|
|
Novice
Joined: 03 Aug 2009 Posts: 10
|
Hi All,
I have a requirement to extract the InputRoot.XMLNSC.ExceptionList as CHAR and save the exception message as CLOB value in the database.
Could you please let me know ways to retrieve the InputRoot.XMLNSC.ExceptionList into CHAR?
Appreciate your help and support.
Regards
JK |
|
Back to top |
|
 |
Vitor |
Posted: Mon Aug 03, 2009 2:14 pm Post subject: Re: Message Broker Extracting tree as CHAR |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
kakkarj wrote: |
Could you please let me know ways to retrieve the InputRoot.XMLNSC.ExceptionList into CHAR?
|
What have you tried that hasn't worked?
What leads you to believe the ExceptionList is part of the XMLNSC domain?
What does the InfoCentre have to say about accessing the ExceptionList? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
smdavies99 |
Posted: Mon Aug 03, 2009 9:12 pm Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
A very similar question was asked not that long ago.
Did you search this forum for help?
As Vitor has said the Info Centre has a lot of information about ptocessing the ExceptionList _________________ 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 |
|
 |
marko.pitkanen |
Posted: Tue Aug 04, 2009 12:18 am Post subject: |
|
|
 Chevalier
Joined: 23 Jul 2008 Posts: 440 Location: Jamsa, Finland
|
Hi,
If you have to create string(cdata or char) or blob representation from message tree try to use ASBITSTREAM and CAST functions.
Marko |
|
Back to top |
|
 |
kakkarj |
Posted: Tue Aug 04, 2009 2:09 am Post subject: |
|
|
Novice
Joined: 03 Aug 2009 Posts: 10
|
Thanks for your response. I tried using the following code but I am able to create a character string
SET exceptionBlob = ASBITSTREAM(InputRoot.ExceptionList
ENCODING InputRoot.MQMD.Encoding
CCSID 1208);
SET exceptionChar = CAST(exceptionBlob AS CHAR CCSID 1208);
Any help will be appreciated. |
|
Back to top |
|
 |
marko.pitkanen |
Posted: Tue Aug 04, 2009 2:23 am Post subject: |
|
|
 Chevalier
Joined: 23 Jul 2008 Posts: 440 Location: Jamsa, Finland
|
Hi,
In our first message you mentioned that you have ExceptionList elemen in path InputRoot.XMLNSC.ExceptionList.
Check out what is the right place refer to.
Marko
PS. If you are interested about exception occured in the flow just processing there is own ExceptionList tree for you (not under InputRoot). |
|
Back to top |
|
 |
WMBDEV1 |
Posted: Tue Aug 04, 2009 2:32 am Post subject: |
|
|
Sentinel
Joined: 05 Mar 2009 Posts: 888 Location: UK
|
kakkarj wrote: |
Thanks for your response. I tried using the following code but I am able to create a character string
SET exceptionBlob = ASBITSTREAM(InputRoot.ExceptionList
ENCODING InputRoot.MQMD.Encoding
CCSID 1208);
SET exceptionChar = CAST(exceptionBlob AS CHAR CCSID 1208);
Any help will be appreciated. |
As smdavies says this question has been asked recently and an answer was provided by kimbert. I suggest you look for this thread for your answer.
As a quick summary, this is caused because the ExceptionList does not have a root parser asscoiated with it and so it cannot be serialised as you expect. To resolve this, copy the tree to a variable in the environment whose domain is XMLNSC. |
|
Back to top |
|
 |
rekarm01 |
Posted: Tue Aug 04, 2009 2:52 am Post subject: Re: Message Broker Extracting tree as CHAR |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 1415
|
kakkarj wrote: |
Thanks for your response. I tried using the following code but I am able to create a character string |
"am", or "am not"? If the former, then problem solved ...
kakkarj wrote: |
Code: |
SET exceptionBlob = ASBITSTREAM(InputRoot.ExceptionList
ENCODING InputRoot.MQMD.Encoding CCSID 1208);
SET exceptionChar = CAST(exceptionBlob AS CHAR CCSID 1208); |
|
"InputRoot.ExceptionList", or "InputRoot.XMLNSC.ExceptionList"?
How is this tree populated? The broker doesn't do that; the message flow would have to.
Assuming the intent is to copy the tree from ExceptionList to Root.XMLNSC.ExceptionList, it might be helpful to start with something like:
Code: |
SET OutputRoot.XMLNSC.ExceptionList = InputExceptionList; |
Though it's possible the XMLNSC parser doesn't handle non-character data so well; in that case, a compute node can recursively copy the elements over one by one, CASTing non-character fields to character fields as needed.
Once that's done, the above code might work better.
Environment.XMLNSC.ExceptionList might work out better, in case Root is needed for something else.
Consult the broker documentation, or the toolkit help, for sample code. |
|
Back to top |
|
 |
|