Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

To identify Hex values

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: To identify Hex values
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    Post subject:
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    Post subject: Reply to: To identify Hex values
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    Post subject: Reply to: To identify Hex values
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

Site Director


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

PostPosted: Wed Dec 02, 2009 3:43 am    Post subject:
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: 2502
Location: Atlanta, Georgia, USA

PostPosted: Wed Dec 02, 2009 4:20 am    Post subject: Reply to: To identify Hex values
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    Post subject: Reply to: To identify Hex values
Reply with quote

Yes, It's resolved.

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

Global Moderator


Joined: 14 Mar 2007
Posts: 10210
Location: italy

PostPosted: Wed Dec 02, 2009 11:54 am    Post subject: Reply to: To identify Hex values
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SQL query to run through list of valu... Ni3-db2 DB2 14 Wed Dec 14, 2016 9:52 am
No new posts Overlaying one set of charater values... Kevin Lindsley SYNCSORT 7 Sat Nov 05, 2016 3:21 am
No new posts Low values Results from VARCHAR FORMAT balaji81_k DB2 10 Thu Oct 20, 2016 1:18 am
No new posts How can we create a flat file in JAVA... rakesh.v18 Java & MQSeries 7 Fri Sep 23, 2016 10:46 pm
No new posts Using 'parm' to vary SORTOUT record v... Sysaron DFSORT/ICETOOL 13 Wed Sep 07, 2016 9:24 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us