Posted: Fri Jul 12, 2002 11:19 pm Post subject: Parsing the Input Message
Novice
Joined: 03 Jul 2002 Posts: 14
I am writing a transformation sub-fow. Input data in my message is coming in following format:
<1byte Hex Start Code>Text Data<1byte Hex End Code><1byte Hex Start Code>Text Data2<1byte Hex End Code>
The start code identifies the field name and thus it is different for all the fields. However the ending code is fixed. There is no fixed order of the fields. I need to parse this message.
I am reading this message as a BLOB and cast it to text data. I want to have a comparision in my code to check for the 1 byte hex code (say 0x34). So I take the 1st character of the data and compare it with the hex code casted to string. It is not working..
What is the best way to accomplish this.Any help is appreciated.
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
Is your "Text Data" length same for all fields in the input message? Could you post the ESQL code where you are trying to compare "StartCode" fields?
Depending on whether the input field length is known or not, you could define your input message format into MRM-CWF or MRM-TDS. You could define startCode and EndCode as binary Data type. For comparing these fields against some value you could use code like,
Code:
IF ( InputRoot.MRM."STARTCODE1" = X'34') THEN
-- Do something
END IF;
Hope this helps. _________________ Kiran
IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries
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