MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Finding value of COMP usage mode item with the hex values

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Problem Determination
View previous topic :: View next topic  
Author Message
vkrishna2001
Beginner


Joined: 07 Aug 2003
Posts: 46
Topics: 18
Location: Danbury

PostPosted: Tue Dec 02, 2003 11:31 am    Post subject: Finding value of COMP usage mode item with the hex values Reply with quote

Hi,
I am analyzing variable storage dump. I want to find the value of a data item with picture clause S9(13)V9(02) COMP.

If the value of data item is +0000000000617.70 then the hexadecimal value is 000000000000F14A. I can give this hexadecimal value directly to scientific calculator and get decimal value as 61770. But if the value is
-0000000000617.70 then the hexadecimal value is FFFFFFFFFFFF0EB6. From this hexadecimal value how to arrive at -61770? Also how can we decide whether the sign is positive or negative?

Thanks,
Vijayakrishna
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Tue Dec 02, 2003 1:30 pm    Post subject: Reply with quote

Krishna,

You can use REXX's funtion X2D which will convert the hexadecimal string to a decimal string
Code:

 /* REXX */                           
 MYNUM   = X2D('000000000000F14A',8)   
 SAY MYNUM                             
 MYNUM   = X2D('FFFFFFFFFFFF0EB6',8)   
 SAY MYNUM                             


This will produce the following results.
Code:

 61770       
-61770     


Check this link which explains in detail the conversion of Hexadecimal to Decimal.

X2D (Hexadecimal to Decimal)


check the following links which can used for other conversions

X2C (Hexadecimal to Character)

X2B (Hexadecimal to Binary)

Hope this helps...

cheers

kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
vkrishna2001
Beginner


Joined: 07 Aug 2003
Posts: 46
Topics: 18
Location: Danbury

PostPosted: Wed Dec 03, 2003 11:09 am    Post subject: Reply with quote

Kolusu,

Thanks a lot for the help.

Vijayakrishna
Back to top
View user's profile Send private message Send e-mail
slade
Intermediate


Joined: 07 Feb 2003
Posts: 266
Topics: 1
Location: Edison, NJ USA

PostPosted: Thu Dec 04, 2003 5:57 pm    Post subject: Reply with quote

Hi Vijay,

Here's another way to convert minus hex values to positive values:

Subtract each hex digit of the minus number from 15 and record the answer. Add 1 to the last digit. It's really a mental arithmetic problem. For example:

FFFFFFFFFFFF0EB6 converts to leading zeros, F149 + 1 = F14A
Code:

F = 15, sub from 15 = 0 = leading zeros
0 =  0, sub from 15 = F 
E = 14, sub from 15 = 1
B = 11, sub from 15 = 4
6 =  6, sub from 15 = 9 + 1 = A


Regards, Jack.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Problem Determination All times are GMT - 5 Hours
Page 1 of 1

 
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


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group