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 » IIB 10.0.0.13 Hexadecimal to Binary and vice versa mechanism

Post new topic  Reply to topic
 IIB 10.0.0.13 Hexadecimal to Binary and vice versa mechanism « View previous topic :: View next topic » 
Author Message
Subhjeet Samal
PostPosted: Thu May 16, 2019 4:29 am    Post subject: IIB 10.0.0.13 Hexadecimal to Binary and vice versa mechanism Reply with quote

Newbie

Joined: 16 May 2019
Posts: 3

How to convert 64 bit hexadecimal into hexabinary and after conversion, how to take the first 48 bits out of the 64 bit converted hexabinary and convert that back to hexadecimal? I have tried using ASBITSTREAM and CAST functions but nothing working. I am using IIB v10.0.0.13.

Last edited by Subhjeet Samal on Fri May 17, 2019 3:14 am; edited 1 time in total
Back to top
View user's profile Send private message
timber
PostPosted: Thu May 16, 2019 5:47 am    Post subject: Reply with quote

Grand Master

Joined: 25 Aug 2015
Posts: 1280

Not sure what you mean by '64 bit hexadecimal'. Do you mean base64?
Please supply the input, your required output and the code that you are currently using.

For bonus points, use [code] blocks for the inputs/outputs and any code. Much easier for us to read.
Back to top
View user's profile Send private message
Subhjeet Samal
PostPosted: Fri May 17, 2019 2:50 am    Post subject: Reply with quote

Newbie

Joined: 16 May 2019
Posts: 3

PLeease find the below esql code i tried for the same :

Code:
DECLARE LogLogid INTEGER FIELDVALUE(InputRoot.XMLNSC.*:DataEventSet.*:dataEvents.*:id); //4750389086465 is a input hexadecimal number
      DECLARE Lcnt,Ldecode,Wcnt1,LoggerID INTEGER ;
      DECLARE LogLogidb, Wtid, Wnv1 BIT;
      SET LogLogidb = CAST(LogLogid AS BIT);
      set Ldecode = cast(LogLogidb AS INTEGER);
      SET Lcnt = LENGTH(LogLogidb);
      SET LogLogidb = LEFT(LogLogidb,48);      
      SET Lcnt = LENGTH(LogLogidb);
      SET Wtid = 0;
      SET Wnv1 = Wtid || LogLogidb ;
      SET Wcnt1 = LENGTH(Wnv1);
        SET Wnv1 = RIGHT(Wnv1,64);   
      SET Wcnt1 = LENGTH(Wnv1);
      DECLARE ff CHARACTER '0xFFFFFFFFFFFF0000';   
      SET LoggerID = cast(Wnv1 AS INTEGER FORMAT ff); // getting 72485185 but the expected hexadecimal value is 4750389084160


RESULT:
input hexadecimal value is = 4750389086465 (InputRoot.XMLNSC.*:DataEventSet.*:dataEvents.*:id)

getting the output is (LoggerID =72485185) but the expected output is 4750389084160
which our front end .NET application getting correctly as below. We are trying the same in esql to achieve




The same is achived by our front end .NET team with below .NET code :

ulong result = id & 0xFFFFFFFFFFFF0000;
return result;


RESULT :
input is id = 4750389086465
output result = 4750389084160
id and result are hexadecimal numbers
Back to top
View user's profile Send private message
Subhjeet Samal
PostPosted: Fri May 17, 2019 2:56 am    Post subject: Reply with quote

Newbie

Joined: 16 May 2019
Posts: 3

Our input and outputs are hexadecimal numbers :
example :
for 4750389086465 inpu hexadecimal number we are expecting 4750389084160 output hexadecimal number .

4750389086465: 0000 0000 0000 0100 0111 0101 0000 0011 1000 1001 0000 1000 0110 0100 0110 0101
4750389084160: 0000 0000 0000 0100 0111 0101 0000 0011 1000 1001 0000 1000 0100 0001 0110 0000


we are trying to convert the hexadecimal number(4750389086465) to hexabinary . After take first 48 bits and then convet the same back to hexadecimal number (4750389084160)
Back to top
View user's profile Send private message
timber
PostPosted: Fri May 17, 2019 4:51 am    Post subject: Reply with quote

Grand Master

Joined: 25 Aug 2015
Posts: 1280

You are making this a lot more complicated than it needs to be. Please bookmark this page in your browser:
https://www.ibm.com/support/knowledgecenter/en/SSMKHH_10.0.0/com.ibm.etools.mft.doc/ak19550_.htm
Look up the BITAND function - it does exactly what you need.

Happy to answer further questions, but please follow up the above first.
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 » IIB 10.0.0.13 Hexadecimal to Binary and vice versa mechanism
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.