IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

To identify Hex values


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
meenakshi_forum
Warnings : 1

Active User


Joined: 27 May 2008
Posts: 121
Location: India

PostPosted: Tue Dec 01, 2009 12:15 pm
Reply with quote

Hi,

Please help me in identifying Hex values of any literal,
it can be a constant, numeric, alphanumeric.

Eg- 3456, open, closed, spaces.

I know the way to do hexon but for each given value above, two lines are being dispalyed, i am unable to make out how to read it?

Say if the field length is 30 bytes, i want to know what is hex value at 27th byte, how will i identify, as the hex value is very long.

Please help.

Thanks
Back to top
View user's profile Send private message
Binop B

Active User


Joined: 18 Jun 2009
Posts: 407
Location: Nashville, TN

PostPosted: Tue Dec 01, 2009 12:35 pm
Reply with quote

Hi Meenakshi,

The two nibbles exactly below your 27th byte will be the hex value of that byte.
Back to top
View user's profile Send private message
Mathiv Anan

Active User


Joined: 23 Jul 2008
Posts: 106
Location: USA

PostPosted: Tue Dec 01, 2009 12:36 pm
Reply with quote

Do you want to identify hex values in cobol program?

Or if you just want to identify the hex values, use hex on and find out.

ex>

444
000

If you issue 'hex on' it displays as copied above for spaces.

so it is hex value of space of 3 bytes. (x'404040').
Back to top
View user's profile Send private message
shaktiprasad

New User


Joined: 20 Aug 2006
Posts: 34
Location: chennai

PostPosted: Tue Dec 01, 2009 5:33 pm
Reply with quote

Hi,

When you put hex on you will able to see some hex values just along with the original values.Hex values will be displayed just below the original values.For example if your value is -3450 and length of your file is 80 bytes then when you put hex on the value will be displayed as:
-3450
6FFFF
03450
Code:
As rest of the bytes are spaces so it will be 4444 as shown by Mathiv
                                              0000
(this is hex value of spaces of 4 bytes)
Code'd to give people half a chance

So don't get confused by seeing these values.Hope it clears your doubt.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Dec 02, 2009 3:43 am
Reply with quote

Hello Meenakshi,

Is this resolved?

If not, using COLS (along with HEX ON) will show a "ruler" that shows the data positions.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Wed Dec 02, 2009 4:20 am
Reply with quote

Programmatically in COBOL -

Code:

03 WS-HEX-BYTE PIC X(01).
03 WS-PACKED PIC 99V9 PACKED-DECIMAL.
03 WS-PACKED-X REDEFINES WS-PACKED PIC X(02).
03 WS-DISPLAY PIC 99V9.

MOVE X'BD' TO WS-HEX-BYTE.
MOVE ZERO TO WS-PACKED.
MOVE WS-HEX-BYTE TO WS-PACKED-X (1:1).
MOVE WS-PACKED TO WS-DISPLAY.
*
* BEFORE THE INSPECT, WS-DISPLAY EQUALS X'FBFDF0'.
*
INSPECT WS-DISPLAY CONVERTING X'FAFBFCFDFEFF' TO 'ABCDEF'.

At this point (and after the INSPECT), WS-DISPLAY (1:2) equals C'BD', with byte-3 equal to C'0', in hex X'C2C4F0'.

Bill
Back to top
View user's profile Send private message
meenakshi_forum
Warnings : 1

Active User


Joined: 27 May 2008
Posts: 121
Location: India

PostPosted: Wed Dec 02, 2009 10:43 am
Reply with quote

Yes, It's resolved.

Thanks a lot to all.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Dec 02, 2009 11:54 am
Reply with quote

it' s good to see that the issue was resolved,
but we still have not understood what it was icon_confused.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts How to identify the transaction categ... IMS DB/DC 3
No new posts Null values are considered in Total c... DFSORT/ICETOOL 6
No new posts Identify Program Insert DB2 7
Search our Forums:

Back to Top