ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Hext to Integer Conversion From Blob message

Post new topic  Reply to topic
 Hext to Integer Conversion From Blob message « View previous topic :: View next topic » 
Author Message
swadheen
PostPosted: Mon Sep 27, 2004 11:39 am    Post subject: Hext to Integer Conversion From Blob message Reply with quote

Newbie

Joined: 17 Aug 2004
Posts: 4


I am getting my input message as Blob . Blob has hex value in it which tells the length of fields in blob message . I have to convert that Hex value to Integer to substring the message fields. e.g I am getting X'6600' in blob it should be converted to 102. I have tried to Cast the Substring of blob to integer but it fails to process it. Looking for help ASAP.
Back to top
View user's profile Send private message
andrewl68
PostPosted: Mon Sep 27, 2004 12:44 pm    Post subject: Reply with quote

Novice

Joined: 23 Sep 2003
Posts: 14

What platform are you running this on??
X'6600' converts to a null terminated 'f' if it is ASCII.

What is the error you are getting?
Back to top
View user's profile Send private message
swadheen
PostPosted: Mon Sep 27, 2004 1:43 pm    Post subject: Reply with quote

Newbie

Joined: 17 Aug 2004
Posts: 4

The Broker is running in AIX env. Followg is the Code I am using

SET Environment.Variables.SEGMENT_LEN_new = cast( ls_payload_length AS INTEGER ccsid InputProperties.CodedCharSetId);
Where ls_payload_length is blob set to X'6600'

The error I am getting is ( from Trace)
Error casting a value from BLOB to INTEGER.
An error occurred when casting a value of data type BLOB to a value of data type INTEGER.
Subsequent messages will indicate the context of the error.
2004-09-27 16:41:21.937345 5147 RecoverableException BIP2456E: The value 'X'6600'' was of an unsuitable length for casting.
The operand of a casting operation was of an unsuitable length for it to be cast to the target data type. For example, BIT operands must have a length divisible by 8 when casting to BLOB.
Back to top
View user's profile Send private message
kirani
PostPosted: Mon Sep 27, 2004 10:17 pm    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

What is the datatype for ls_payload_length ? What happens when you try to cast it as CHAR?
_________________
Kiran


IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries

Back to top
View user's profile Send private message Visit poster's website
kimbert
PostPosted: Tue Sep 28, 2004 5:56 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
I have to convert that Hex value to Integer to substring the message fields
Have you considered using MRM (CWF or TDS) to do this for you?
Back to top
View user's profile Send private message
RocknRambo
PostPosted: Tue Sep 28, 2004 6:11 am    Post subject: Reply with quote

Partisan

Joined: 24 Sep 2003
Posts: 355

wanna try this....


DECLARE ls_payload_length BLOB;

SET Environment.Variables.SEGMENT_LEN_new =
CAST( ls_payload_length AS CHAR ccsid 1208);
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Hext to Integer Conversion From Blob message
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.