Posted: Tue Oct 30, 2012 8:25 pm Post subject: how to remove the first few bytes from BLOB msg
Disciple
Joined: 25 Jul 2010 Posts: 176
Hi,
I have a message coming in from some adapter with a length of say 100 bytes. I need to delete the first 30 bytes and also read the fields present in the first 30 bytes and map it to a fields present at the other end.
I tried this way.
SUBSTRING(InputBody.BLOB.BLOB from 1 for 10).
I want to read the first 10 bytes.
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
Perhaps you should look at the differences between
Code:
InputRoot.
and
Code:
InputBody
In future, you might like to also think about adding a bit more detail to the statement
Quote:
But this is not working.
How did you know this?
What did you observe to enable you to come up with this statement?
What other things have you tried in order to solve this?
Did you take a user trace and see what it says?
This can be very enlightening.
The more detail you supply, the more we can help. A lack of detail may result in you being given suggestions that you have already tried. _________________ 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.
Posted: Wed Oct 31, 2012 12:51 am Post subject: how to remove the first few bytes from BLOB msg
Disciple
Joined: 25 Jul 2010 Posts: 176
Thanks for your suggestion. Actually I used InputRoot instead of InputBody and its really working.
Thanks.
Adding on to it. How do I map the bytes in the BLOB msg to a XML structure.
Ex :
SET OutputRoot.XMLNSC.name = SUBSTRING(InputRoot.BLOB.BLOB from 1 for 5);
I am trying the above and in user trace its just coming a BLOB msg itself i.e some numbers. How do I change it to a readable format?
You are converting a non-XML input message to an XML output message. You should be using the DFDL ( if on v8 ) or MRM ( if on v7 ) parser to parse your input message. Trying to do the parsing using ESQL is
a) doing it the hard way and
b) creating a problem for future maintainers of your flow.
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