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 » Hex conversion

Post new topic  Reply to topic
 Hex conversion « View previous topic :: View next topic » 
Author Message
prasannanb
PostPosted: Thu Jul 19, 2012 4:02 am    Post subject: Hex conversion Reply with quote

Apprentice

Joined: 17 Apr 2009
Posts: 35

How can I convert hex value to decimal in esql.
Ex: input: A (as characters)
output: 10 (as integer)

Please help
Back to top
View user's profile Send private message
kimbert
PostPosted: Thu Jul 19, 2012 4:45 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

That's a very basic question. I know the answer, but I refuse to give you the answer until you answer the following questions:
- what is your message flow trying to do ( why do you need to do this) ?
- have you considered using the MRM or DFDL parser to do this conversion?
- Did you look for the answer in the WMB info center before posting?
Back to top
View user's profile Send private message
prasannanb
PostPosted: Thu Jul 19, 2012 11:16 pm    Post subject: Reply with quote

Apprentice

Joined: 17 Apr 2009
Posts: 35

The answer is:
1) prefix the incoming hex chars with 0x
ex: DECLARE cC CHARACTER '0x' || FIELDVALUE(InputRoot.MRM.hexval)
2) Cast char to int
DECLARE nN INTEGER CAST(cC AS INTEGER CCSID 1208);

Thanks for the help
Back to top
View user's profile Send private message
mqjeff
PostPosted: Fri Jul 20, 2012 6:25 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

prasannanb wrote:
The answer is:
1) prefix the incoming hex chars with 0x
ex: DECLARE cC CHARACTER '0x' || FIELDVALUE(InputRoot.MRM.hexval)
2) Cast char to int
DECLARE nN INTEGER CAST(cC AS INTEGER CCSID 1208);

Thanks for the help


No, that's a solution, not *the* answer.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Sat Jul 21, 2012 7:34 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

mqjeff wrote:
prasannanb wrote:
The answer is:
1) prefix the incoming hex chars with 0x
ex: DECLARE cC CHARACTER '0x' || FIELDVALUE(InputRoot.MRM.hexval)
2) Cast char to int
DECLARE nN INTEGER CAST(cC AS INTEGER CCSID 1208);

Thanks for the help


No, that's a solution, not *the* answer.

Especially as the question is still quite unclear. We have no idea why he wants/needs to do this...
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Hex conversion
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.