Author |
Message
|
SDS |
Posted: Thu Oct 13, 2011 10:25 pm Post subject: URGENT: How to convert a message from MRM to BLOB Domain??? |
|
|
 Apprentice
Joined: 13 Jun 2011 Posts: 47
|
Hi,
I have to work with TLOG files in WMB7.
The issue is that I have converted TLOGRAW which is in BLOB format to MRM and done some manipulations with some fields.
Now again I have to convert it back to BLOB format.
Plz let me know how can I convert it back to BLOB from MRM.
 |
|
Back to top |
|
 |
kimbert |
Posted: Fri Oct 14, 2011 12:17 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
I assume that you have based your solution on the TLOG sample supplied with WMB v7?
To convert an MRM message tree to a BLOB, you need the ASBITSTREAM function. Please use the search tool to find examples of how to use it. Or, if you are really unusual, read the info center topic on ASBITSTREAM.  |
|
Back to top |
|
 |
SDS |
Posted: Fri Oct 14, 2011 12:26 am Post subject: |
|
|
 Apprentice
Joined: 13 Jun 2011 Posts: 47
|
Hi Kimbert,
Thanks a lot for the reply.
I have used ASBITSTREAM function and the messages is converted to BLOB format.
But it is also throwing a Parser Exception too after executing this line.
SET OutputRoot.BLOB.BLOB = CAST(ASBITSTREAM(InputRoot.MRM) AS BLOB);
Exception:
------------
Quote: |
ParserException
File:CHARACTER:F:\build\S000_P\src\MTI\MTIforBroker\MtiImbParser2\MtiImbSyntaxElement.cpp
Line:INTEGER:595 Function:CHARACTER:CpContext::loadWorker Type:CHARACTER: Name:CHARACTER: Label:CHARACTER: Catalog:CHARACTER:BIPmsgs Severity:INTEGER:3 Number:INTEGER:5136 Text:CHARACTER:Invalid Wire format retreived.
|
Please help me out.  |
|
Back to top |
|
 |
kimbert |
Posted: Fri Oct 14, 2011 12:30 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
What is the return type of the ASBITSTREAM function?
What are the parameters of the ASBITSTREAM function?
These are programming basics. Please do the basics before asking for help. There is example code available via the search button. |
|
Back to top |
|
 |
SDS |
Posted: Fri Oct 14, 2011 12:42 am Post subject: |
|
|
 Apprentice
Joined: 13 Jun 2011 Posts: 47
|
Hi Kimbert.
Thanks a lot for the prompt reply.
Actually I am not very experienced in WMB and I have not used ASBITSTREAM before.
Also first time I am working with TLOGs.
I am sharing the part of the code to convert MRM message to BLOB.
Quote: |
SET OutputRoot.Properties.MessageSet = '';
SET OutputRoot.Properties.MessageType = '';
SET OutputRoot.Properties.MessageFormat = 'BLOB';
SET OutputRoot.MQMD.Format = 'MQRFH2 ';
SET OutputRoot.MQMD.Version = 2;
SET OutputRoot.MQMD.Persistence = 1;
SET OutputRoot.MQMD.Expiry = -1;
SET OutputRoot.MQRFH2.(MQRFH2.Field)Version = 2;
SET OutputRoot.BLOB.BLOB = CAST(ASBITSTREAM(InputRoot.MRM) AS BLOB); |
Please let me know what should I have to do to avoid this parser exception as given below?? |
|
Back to top |
|
 |
kimbert |
Posted: Fri Oct 14, 2011 1:00 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
Actually I am not very experienced in WMB and I have not used ASBITSTREAM before. |
I believe you. Lack of experience with WMB or ASBITSTREAM is not your problem. You seem to have a problem with following advice, or reading documentation. |
|
Back to top |
|
 |
SDS |
Posted: Fri Oct 14, 2011 1:21 am Post subject: |
|
|
 Apprentice
Joined: 13 Jun 2011 Posts: 47
|
Hey!
I have updated the code as:
Quote: |
DECLARE parseOptions INTEGER BITOR(FolderBitStream, ValidateContent,
ValidateValue, ValidateLocalError);
SET OutputRoot.BLOB.BLOB = CAST(ASBITSTREAM(InputRoot.MRM OPTIONS parseOptions
SET OutputRoot.Properties.MessageSet
TYPE OutputRoot.Properties.MessageType
FORMAT OutputRoot.Properties.MessageFormat) AS BLOB); |
But now it is giving parser error as:
RM Worker Not Found
Can you plz tell me how can I resolve this. |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Oct 14, 2011 1:45 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
SDS wrote: |
Hey!
I have updated the code as:
Quote: |
DECLARE parseOptions INTEGER BITOR(FolderBitStream, ValidateContent,
ValidateValue, ValidateLocalError);
SET OutputRoot.BLOB.BLOB = CAST(ASBITSTREAM(InputRoot.MRM OPTIONS parseOptions
SET OutputRoot.Properties.MessageSet
TYPE OutputRoot.Properties.MessageType
FORMAT OutputRoot.Properties.MessageFormat) AS BLOB); |
But now it is giving parser error as:
RM Worker Not Found
Can you plz tell me how can I resolve this. |
Updating the code was not the solution. The solution is to read up on ASBITSTREAM and understand the output and parameters of it.
As Kimbert said you do not seem keen on following advice... so expect no more ...
As a hint what is the value of your SET TYPE and FORMAT parameters? What is the expected value of those parameters?
What is the value of your CCSID parameter?
 _________________ MQ & Broker admin |
|
Back to top |
|
 |
SDS |
Posted: Fri Oct 14, 2011 2:49 am Post subject: |
|
|
 Apprentice
Joined: 13 Jun 2011 Posts: 47
|
Hi,
Sorry but I am not able to find out the error, that's why I want some help as this work is very urgent for me.
It would be very much helpful for me if anyone points out the error and let me know what should be done to resolve this.
Below is the code which is converting the MRM to BLOB but also throwing a parser error as : RM Worker Not Found
Quote: |
SET OutputRoot.Properties.MessageSet = '';
SET OutputRoot.Properties.MessageType = '';
SET OutputRoot.Properties.MessageFormat = 'BLOB';
SET OutputRoot.MQMD.Format = 'MQRFH2 ';
SET OutputRoot.MQMD.Version = 2;
SET OutputRoot.MQMD.Persistence = 1;
SET OutputRoot.MQMD.Expiry = -1;
SET OutputRoot.MQRFH2.(MQRFH2.Field)Version = 2;
DECLARE parseOptions INTEGER BITOR(FolderBitStream, ValidateContent,
ValidateValue, ValidateLocalError);
SET OutputRoot.BLOB.BLOB = CAST(ASBITSTREAM(InputRoot.MRM OPTIONS parseOptions
SET OutputRoot.Properties.MessageSet
TYPE OutputRoot.Properties.MessageType
FORMAT OutputRoot.Properties.MessageFormat) AS BLOB CCSID 1208);
|
Thanks a lot in advance. |
|
Back to top |
|
 |
smdavies99 |
Posted: Fri Oct 14, 2011 3:26 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
You are telling broker to parse the message using a message set.
Code: |
SET OutputRoot.Properties.MessageSet
|
Yet...
Code: |
SET OutputRoot.Properties.MessageSet = '';
SET OutputRoot.Properties.MessageType = '';
|
The message you are seeing usually happens when you are trying to parse a message using a message set and the message set is not deployed to that broker.
In your case, you are doing the reverse. I'll lead you to draw your own conclusions as to the suitability of your code. _________________ 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 |
|
 |
SDS |
Posted: Fri Oct 14, 2011 3:43 am Post subject: |
|
|
 Apprentice
Joined: 13 Jun 2011 Posts: 47
|
hey!
I have done it myself!!
Thanks for all the help.
I just need to replace all 'OutputRoot' with 'InputRoot' in the argument of ASBITSTREAM function to resolve the issue.  |
|
Back to top |
|
 |
Vitor |
Posted: Fri Oct 14, 2011 4:37 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
SDS wrote: |
I just need to replace all 'OutputRoot' with 'InputRoot' in the argument of ASBITSTREAM function to resolve the issue.  |
Yes, turning the InputRoot into a BLOB using options based on the InputRoot will usually work much better than options based on something else. Especially something you've blanked out earlier in the code. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
|