Posted: Fri Jul 12, 2002 11:19 pm Post subject: Comparison of hex values
Novice
Joined: 03 Jul 2002 Posts: 14
i have an input stream of data which have some 1 byte fields set to hex values in between the stream of character data
Now i need to read this stream, extract those 1 byte of data and compare them to their respective hex values and based on the result of comparison do some processing
how can i accomplish this ??
what shud i cast the incoming stream to ??
then after extracting each byte in whta type of variables should i store them temporarily
and later how can i do the comparison ???(to some hex values )
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
If you are reading your input message as BLOB, you already have data in HEX format. You could define temp variable as BLOB and then extract values from input message into it. For comparision you should use something like,
Code:
DECLARE STCODE1 BLOB;
SET STCODE1 = SUBSTRING(BITSTREAM(InputBody) FROM 1 FOR 1);
IF (STCODE1 = X'3C') THEN
-- Do some processing;
END IF;
_________________ 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