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 » Transform String in HEX format to ASCII representation

Post new topic  Reply to topic
 Transform String in HEX format to ASCII representation « View previous topic :: View next topic » 
Author Message
jbustamante
PostPosted: Tue May 03, 2005 1:57 pm    Post subject: Transform String in HEX format to ASCII representation Reply with quote

Novice

Joined: 06 Oct 2004
Posts: 11

Hi! first of all, sorry for my english, I'm a chilean people.
I have an xml message where it comes a value that is in HEX format. I have to transform this HEX "string" into the ASCII representation.
With an example:
The input message is
<TRX>
<someValue>A001</someValue>
<otherValue>0125</otherValue>
</TRX>

I need to transform this values to
<TRX>
<result>..</result> [A0 and 01 has no representation in ASCII]
<result>.%</result> [01 same as above end 25 is % in ASCII]
</TRX>

with the following ESQL (as example) code:

DECLARE blbCDATA BLOB;
DECLARE chrDATA CHAR InputRoot.XML.TRX.someValue;

SET blbCDATA = CAST(chrDATA AS BLOB);
SET chrDATA = CAST(blbCDATA AS CHARACTER CCSID InputRoot.Properties.CodedCharSetId);
SET OutputRoot.XML.TRX.result=chrDATA;


I get:


<TRX>
<result>41303031</result>
<result>30313235</result>
</TRX>


Can you help me with this, better if it is with an ESQL Example.
Back to top
View user's profile Send private message MSN Messenger
martinrydman
PostPosted: Tue May 03, 2005 10:38 pm    Post subject: Reply with quote

Centurion

Joined: 30 Jan 2004
Posts: 139
Location: Gothenburg, Sweden

Hi,

I'm not exactly sure why you don't get it to work. I tried your code and it worked right off (as I would have expected, since it is correct). I can only assume that maybe your message comes with the wrong CCSID or some other such thing.

/Martin
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 » Transform String in HEX format to ASCII representation
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.