Author |
Message
|
matuwe |
Posted: Wed May 26, 2010 6:41 am Post subject: CAST To BLOB on AIX |
|
|
 Master
Joined: 05 Dec 2007 Posts: 296
|
Please help, (cry)
I have a file which I am trying to cast to blob and I am getting a short message, compared to if the same test data is pushed to a queue.
This results is the original blob message from a MQinput (No parsing) InputRoot.BLOB.BLOB
X'30303035363132333437353839383030333437393844414e4941202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202031323334353630303131303030323338373038313030303030303154454d504c4154452020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020434851534f4c30303120202020202020202020202020202020202020202020202020202020202020202020202020202020200d0a3030303637383030303735383938303033343739384e49564554484954484120202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202031343732353830303231303030323939393939313030303030303254454d504c4154453220202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020434851534f4c3030352020202020202020202020202020202020202020202020202020202020202020202020202020202020' (BLOB)
This results is from ESQL cast to blob
The difference is , the data here was received from XML XPATH
DECLARE inCCSID INT 1208;
DECLARE inEncoding INT InputProperties.Encoding;
SET Environment.Data = CAST(InputRoot.XMLNSC.ESB_INTERNAL.ESB_DATA.payload AS BLOB CCSID inCCSID ENCODING inEncoding );
X'30303035363132333437353839383030333437393844414e4941202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202031323334353630303131303030323338373038313030303030303154454d504c4154452020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020434851534f4c30303120202020202020202020202020202020202020202020202020202020202020202020202020202020203030303637383030303735383938303033343739384e49564554484954484120202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202031343732353830303231303030323939393939313030303030303254454d504c4154453220202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020434851534f4c303035' (BLOB)
The input message is data is identical
What am I doing wrong.. |
|
Back to top |
|
 |
mqjeff |
Posted: Wed May 26, 2010 7:12 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
What does a usertrace show?
What is producing the results you have shown? A Trace node? User trace? an output message? |
|
Back to top |
|
 |
matuwe |
Posted: Thu May 27, 2010 9:27 am Post subject: |
|
|
 Master
Joined: 05 Dec 2007 Posts: 296
|
Yes I created a trace node, then read the blob from the trace node (file output) If I remove the CCSID 1208 to InputRoot. CCSID then it seems to look identical. One last thing I saw was the missing part of the BLOB is actually spaces at the end of the last line.
I am not doing any trim, could this be caused by CAST to BLOB with CCSID 1208?
Please help, I am not sure what CCSID actually does. My real problem is I am parsing using ESQL, If I read this peace of data from XPATH value in the incoming DATA, the I get PARSE Vaidation error. But if I copy the data and send it directly to a flow using a MQInput Node that receives BLOB , then the same PARSE code works. |
|
Back to top |
|
 |
matuwe |
Posted: Thu May 27, 2010 9:45 am Post subject: |
|
|
 Master
Joined: 05 Dec 2007 Posts: 296
|
The difference is the stand alone flow is
MQInput >> Compute node (PARSE and Validate) >> XSLT >> MQOUT and it works
The second one is MQInput >> Comput node read data from DB >> PARSE one XPATH value(same as previouse >> XSLT >> MQout.
The dataand msgset is totally the same. I read it from the database as charecters no trim, and I thought casting to blob might help
Code: |
SET Environment.Data = InputRoot.XMLNS.ESB_INTERNAL.ESB_DATA.payload;
DECLARE parseOptions INTEGER BITOR (ValidateContentAndValue,ValidateException,ValidateImmediate);
Create LASTCHILD OF Environment.TEST DOMAIN ('MRM') PARSE(Environment.Data
OPTIONS parseOptions
SET procedurename
TYPE msgTYPE
FORMAT msgFORMAT
ENCODING InputRoot.Properties.Encoding
CCSID InputRoot.Properties.CodedCharSetId
);
|
|
|
Back to top |
|
 |
inMo |
Posted: Thu May 27, 2010 9:54 am Post subject: |
|
|
 Master
Joined: 27 Jun 2009 Posts: 216 Location: NY
|
Perhaps you have solved this? If not, try using
Code: |
CCSID InputRoot.Properties.CodedCharSetId |
in the cast statement instead of '1208'. |
|
Back to top |
|
 |
matuwe |
Posted: Thu May 27, 2010 10:08 am Post subject: |
|
|
 Master
Joined: 05 Dec 2007 Posts: 296
|
yes i have and my data looks better, But now I am still getting an error on PARSE, as the messageset gives a validation error on data that validates fine on MQInput? I guess I am asking a million questions on one line.
1. If I am doing a PARSE in ESQL, do I need to send BLOB data or can it be anything (BLOB or CHARECTER) ?
2. If I am doing a CAST to BLOB, why does the empty spaces at the end of data gets trimed (removes spaces)
3. Does the field type on my xml cause this?
The only puzzle for me, is this works with any data but only 3 rows (datafiles) fail's. |
|
Back to top |
|
 |
kimbert |
Posted: Thu May 27, 2010 11:40 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
1. Either will work, although the info center will claim that you can only use BLOB.
2. and 3. I don't fully understand the questions, but I'm fairly sure that you could answer these questions for yourself by taking mqjeff's advice and taking a user trace. Or use the debugger to step through the ESQL. |
|
Back to top |
|
 |
|