Author |
Message
|
scar |
Posted: Thu Jul 16, 2009 12:48 pm Post subject: UnknownParserName = 'MQSTR' Issue |
|
|
Centurion
Joined: 23 Jun 2004 Posts: 145
|
We are converting tab delimited message coming from Mainframe to XML and it works file, on AIX
CREATE COMPUTE MODULE ConvertTABtoXML_TabtoXML
CREATE FUNCTION main() RETURNS BOOLEAN BEGIN
DECLARE C INTEGER;
SET C = CARDINALITY(InputRoot.*[]);
DECLARE I INTEGER;
DECLARE x INTEGER;
SET I = 1;
WHILE I < C DO
SET OutputRoot.*[I] = InputRoot.*[I];
SET I=I+1;
END WHILE;
SET "OutputRoot"."MQMD"."CorrelId" = "InputRoot"."MQMD"."CorrelId";
SET "OutputRoot"."MQMD"."MsgId" = "InputRoot"."MQMD"."MsgId";
DECLARE TAB BLOB;
SET TAB = CAST ('09' AS BLOB);
DECLARE tempString BLOB;
DECLARE intSearchString INTEGER;
DECLARE tempBlob CHARACTER;
DECLARE tBlob CHARACTER;
DECLARE ts CHARACTER;
DECLARE ts_len INTEGER;
SET I=1;
SET tempBlob = CAST( SUBSTRING(InputRoot."BLOB"."BLOB" FROM 1 for 1) AS CHARACTER CCSID InputRoot.MQMD.CodedCharSetId);
--// This loop converts blob to character and ' to space
SET intSearchString=2;
WHILE (intSearchString <= LENGTH(InputRoot."BLOB"."BLOB")) DO
if ( SUBSTRING(CAST( InputRoot."BLOB"."BLOB" AS CHARACTER CCSID InputRoot.MQMD.CodedCharSetId) FROM intSearchString FOR 1) = '''') THEN
SET tempBlob = tempBlob || ' ';
else
SET tempBlob = tempBlob || CAST (SUBSTRING(InputRoot."BLOB"."BLOB" FROM intSearchString FOR 1) AS CHARACTER CCSID InputRoot.MQMD.CodedCharSetId);
END IF;
SET intSearchString=intSearchString+1;
END WHILE;
Now we are getting the same messages from a linux machine and I am getting the following error in the trace
Root : (
(0x01000000):Properties = (
(0x03000000):MessageSet = ''
(0x03000000):MessageType = ''
(0x03000000):MessageFormat = ''
(0x03000000):Encoding = 273
(0x03000000):CodedCharSetId = 1208
(0x03000000):Transactional = TRUE
(0x03000000):Persistence = TRUE
(0x03000000):CreationTime = GMTTIMESTAMP '2009-07-16 20:34:53.440'
(0x03000000):ExpirationTime = -1
(0x03000000):Priority = 4
(0x03000000):ReplyIdentifier = X'414d512049415342562e4430312e42524a5f5cbc20006703'
(0x03000000):ReplyProtocol = 'MQ'
(0x03000000):Topic = NULL
(0x03000000):ContentType = ''
)
(0x01000000):MQMD = (
(0x03000000):SourceQueue = 'INQ'
(0x03000000):Transactional = TRUE
(0x03000000):Encoding = 273
(0x03000000):CodedCharSetId = 1208
(0x03000000):Format = 'MQSTR '
(0x03000000):Version = 2
(0x03000000):Report = 0
(0x03000000):MsgType = 1
(0x03000000):Expiry = -1
(0x03000000):Feedback = 0
(0x03000000):Priority = 4
(0x03000000):Persistence = 1
(0x03000000):MsgId = X'414d512049415342562e4430312e42524a5f5cbc20008606'
(0x03000000):CorrelId = X'414d512049415342562e4430312e42524a5f5cbc20006703'
(0x03000000):BackoutCount = 0
(0x03000000):ReplyToQ = 'ASDF '
(0x03000000):ReplyToQMgr = 'XYZABC '
(0x03000000):UserIdentifier = 'mqm '
(0x03000000):AccountingToken = X'160105150000005766e2628177d97407e53b2bef03000000000000000000000b'
(0x03000000):ApplIdentityData = ' '
(0x03000000):PutApplType = 11
(0x03000000):PutApplName = 'rfhutil_V6\ih03\rfhutilc.exe'
(0x03000000):PutDate = DATE '2009-07-16'
(0x03000000):PutTime = GMTTIME '20:34:53.440'
(0x03000000):ApplOriginData = ' '
(0x03000000):GroupId = X'000000000000000000000000000000000000000000000000'
(0x03000000):MsgSeqNumber = 1
(0x03000000):Offset = 0
(0x03000000):MsgFlags = 0
(0x03000000):OriginalLength = -1
)
(0x01000000):BLOB = (
(0x03000000):UnknownParserName = 'MQSTR'
(0x03000000):BLOB = X'304e495120204441202030303120373336373920494153203238363533302020202020093030310931095a505231382053484320646f6573206e6f7420657869737420696e2
0464d4d493a203035313238313430485641'
)
Any help is appreciated. |
|
Back to top |
|
 |
Vitor |
Posted: Thu Jul 16, 2009 10:51 pm Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Whoever's sending it from linux is not using the constant to set up the MQMD Format field. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
scar |
Posted: Fri Jul 17, 2009 5:14 am Post subject: |
|
|
Centurion
Joined: 23 Jun 2004 Posts: 145
|
(0x03000000):Format = 'MQSTR ' the format is srt to MQSTR, is that wrong,
It looks like they are sending the data in character format .
If I do
DECLARE TAB BLOB;
SET TAB = CAST( SUBSTRING(InputRoot."CHARACTER"."CHARACTER" FROM 1 for 1) AS BLOB CCSID InputRoot.MQMD.CodedCharSetId);
I am not seeing an error,
though I am not able to get the data from the message.
When I try to cast the TAB as character I am getting the same error
DECLARE tempBlob CHARACTER;
SET tempBlob = CAST( TAB AS CHARACTER CCSID InputRoot.MQMD.CodedCharSetId); |
|
Back to top |
|
 |
WMBDEV1 |
Posted: Fri Jul 17, 2009 5:27 am Post subject: |
|
|
Sentinel
Joined: 05 Mar 2009 Posts: 888 Location: UK
|
Have you tried running a user trace to determine the exact error that you
are getting?
Why are you using InputRoot.Character? |
|
Back to top |
|
 |
scar |
Posted: Fri Jul 17, 2009 5:41 am Post subject: |
|
|
Centurion
Joined: 23 Jun 2004 Posts: 145
|
I turned the trace on, but nothing in the trace file
mqsichangetrace BROKERXYZ -u -e default -f ConvertTABtoXML -l debug -r
mqsireadlog BROKERXYZ -u -e default -o Trace.xml
mqsiformatlog -i Trace.xml -o Trace.txt
This is what I am seeing in the trace file
Timestamps are formatted in local time, 300 minutes before GMT.
Trace written by version ; formatter version 6001
Threads encountered in this trace: |
|
Back to top |
|
 |
WMBDEV1 |
Posted: Fri Jul 17, 2009 5:44 am Post subject: |
|
|
Sentinel
Joined: 05 Mar 2009 Posts: 888 Location: UK
|
Did you put the message between the changelog and readlog commands?
Can you answer my other question also? |
|
Back to top |
|
 |
scar |
Posted: Fri Jul 17, 2009 6:00 am Post subject: |
|
|
Centurion
Joined: 23 Jun 2004 Posts: 145
|
From Mainframe we know that we are getting a BLOB,
When I opened the message we are getting from the unix machine , its in character format , not in BLOB.
I tried doing
SET tempBlob = SUBSTRING(InputRoot FROM 5 for 10);
didnt work
Then I Thought lets try with a CHARACTER and see what happens,
It didnt gave me the error, but neither letting me convert it back to character.
tried the trace couple time but didnt work. |
|
Back to top |
|
 |
scar |
Posted: Fri Jul 17, 2009 6:27 am Post subject: |
|
|
Centurion
Joined: 23 Jun 2004 Posts: 145
|
I know CHARACTER.CHARACTER doesnt make any sense, but just trying difdernt things. |
|
Back to top |
|
 |
smdavies99 |
Posted: Fri Jul 17, 2009 6:28 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
scar wrote: |
From Mainframe we know that we are getting a BLOB,
|
Every Message as it arrives into Broker is a BLOB. You flow can then say,
"Hey, this message should be in XML Format. Here is how it should look. Please try and parse it for me"
BLOB in this context means : A format that I don't know about (or sometimes even care). It could sometimes be a BINARY Object or it could be plain text or XML or a TDS formatted string.
That is why when you open it on Unix, you see a message in Character Format.
To get a user trace there are FIVE Steps.
1) Enable Trace
2) Put message through the Flow
3) Stop the Trace
4) Read the Trace
5) Format the Trace into someting remotely human readable. _________________ 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 |
|
 |
scar |
Posted: Fri Jul 17, 2009 7:23 am Post subject: |
|
|
Centurion
Joined: 23 Jun 2004 Posts: 145
|
I put the trace on the exec group insted of the flow.
mqsichangetrace BROKERXYZ -u -e default -l debug -r
mqsireadlog BROKERXYZ -u -e default -o Trace.xml
mqsiformatlog -i Trace.xml -o Trace.txt
this is what I am seeing
Timestamps are formatted in local time, 300 minutes before GMT.
Trace written by version ; formatter version 6001
2009-07-17 10:20:59.416444 7711 UserTrace BIP4040I: The Execution Group ''FFATA'' has processed a configuration message successfully.
A configuration message has been processed successfully. Any configuration changes have been made and stored persistently.
No user action required.
2009-07-17 10:20:59.430700 7711 UserTrace BIP2638I: The MQ output node 'ConfigurationMessageFlow.outputNode' attempted to write a message to queue ''SYSTEM.BROKER.EXECUTI
ONGROUP.REPLY'' connected to queue manager ''IASBV.D01.BROKER''. The MQCC was '0' and the MQRC was '0'.
2009-07-17 10:20:59.430776 7711 UserTrace BIP2622I: Message successfully output by output node 'ConfigurationMessageFlow.outputNode' to queue ''SYSTEM.BROKER.EXECUTIONGRO
UP.REPLY'' on queue manager ''IASBV.D01.BROKER''.
2009-07-17 10:21:39.309740 7711 UserTrace BIP2632I: Message received and propagated to 'out' terminal of MQ input node 'ConfigurationMessageFlow.InputNode'.
2009-07-17 10:21:39.310048 7711 UserTrace BIP6060I: Parser type ''Properties'' created on behalf of node 'ConfigurationMessageFlow.InputNode' to handle portion of incomin
g message of length 0 bytes beginning at offset '0'.
2009-07-17 10:21:39.310188 7711 UserTrace BIP6061I: Parser type ''MQMD'' created on behalf of node 'ConfigurationMessageFlow.InputNode' to handle portion of incoming mess
age of length '364' bytes beginning at offset '0'. Parser type selected based on value ''MQHMD'' from previous parser.
2009-07-17 10:21:39.310496 7711 UserTrace BIP6061I: Parser type ''XMLS'' created on behalf of node 'ConfigurationMessageFlow.InputNode' to handle portion of incoming mess
age of length '237' bytes beginning at offset '364'. Parser type selected based on value ''XMLS'' from previous parser.
Threads encountered in this trace:
7711 |
|
Back to top |
|
 |
WMBDEV1 |
Posted: Mon Jul 20, 2009 12:26 am Post subject: |
|
|
Sentinel
Joined: 05 Mar 2009 Posts: 888 Location: UK
|
scar wrote: |
I put the trace on the exec group insted of the flow.
|
Doesnt matter.
I still dont think you are putting the message in between turning the trace on and reading the message or you are doing something else fundamentally wrong! |
|
Back to top |
|
 |
smdavies99 |
Posted: Mon Jul 20, 2009 2:41 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
Remember the -r switch on the mqsichangetrace command resets the trace.
So to iterate again,
1) Enable the trace (use the -r option)
2) put one or more messages through the flow
3) disable trace ( -l none and don't use the -r option)
4) mqsireadlog
5) mqsiformatlog _________________ 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 |
|
 |
rekarm01 |
Posted: Mon Jul 20, 2009 3:00 am Post subject: Re: UnknownParserName = 'MQSTR' Issue |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 1415
|
scar wrote: |
Now we are getting the same messages from a linux machine and I am getting the following error in the trace |
What error? There's following output from a Trace node, but there's no following error in the trace.
scar wrote: |
Code: |
(0x01000000):BLOB = (
(0x03000000):UnknownParserName = 'MQSTR'
...
) |
|
This is not an error ... unless the domain should be something other than 'BLOB'.
scar wrote: |
From Mainframe we know that we are getting a BLOB,
When I opened the message we are getting from the unix machine, its in character format, not in BLOB. |
Please explain. What do you believe that "BLOB" means? What are you using to "open" the message? What is it about the mainframe message that leads you to believe that it's a BLOB, but the Unix message is not?
Every MQ message is encoded as a sequence of bytes. Any application that gets a message may subsequently convert it to some other format (such as bytes->characters, bytes->hexadecimal values, or bytes->BLOB), depending on the logic of the application. For a message flow that uses the BLOB parser to parse messages, every message is a BLOB.
scar wrote: |
Code: |
SET "OutputRoot"."MQMD"."CorrelId" = "InputRoot"."MQMD"."CorrelId";
SET "OutputRoot"."MQMD"."MsgId" = "InputRoot"."MQMD"."MsgId"; |
|
Having just copied the message headers, this code is redundant. And the double-quotes are doubly unnecessary.
scar wrote: |
Code: |
--// This loop converts blob to character and ' to space |
|
This loop converts blob to character one byte at a time. It will throw a Conversion Exception for multi-byte characters, such as non-ASCII UTF-8 characters.
Consider replacing the loop with a call to the ESQL TRANSLATE() or REPLACE() functions instead.
scar wrote: |
I put the trace on the exec group insted of the flow. |
Don't do that; it just clutters up the usertrace with unrelated messages. |
|
Back to top |
|
 |
smdavies99 |
Posted: Mon Jul 20, 2009 3:33 am Post subject: Re: UnknownParserName = 'MQSTR' Issue |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
rekarm01 wrote: |
scar wrote: |
I put the trace on the exec group insted of the flow. |
Don't do that; it just clutters up the usertrace with unrelated messages. |
Unless:-
1) There are no other flows in that EG processing messages at that time
When I'm developing flows, I have the commands to enable trace nd to disable/read/format it setup as scripts. To save time, effort and for convienence, I usually just enable it at the EG level rather than for each flow.
If there are other flows in that EG which might be processing messages while you have trace enabled then set the trace at Flow level. Otherwise, it does not matter. _________________ 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 |
|
 |
rekarm01 |
Posted: Mon Jul 20, 2009 4:37 am Post subject: Re: UnknownParserName = 'MQSTR' Issue |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 1415
|
smdavies99 wrote: |
rekarm01 wrote: |
scar wrote: |
I put the trace on the exec group insted of the flow. |
Don't do that; it just clutters up the usertrace with unrelated messages. |
Unless:-
1) There are no other flows in that EG processing messages at that time
... Otherwise, it does not matter. |
There are always other flows.
Execution groups have "hidden" message flows, to handle incoming configuration messages, such as start/stop/deploy/mqsichangetrace requests, etc. See "scars" previous usertrace for an example of this.
Setting usertrace at the execution group level will include usertrace output for these hidden message flows as well. |
|
Back to top |
|
 |
|