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

Need help to Read Hex when HEX ON


IBM Mainframe Forums -> TSO/ISPF
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Ashish.Srivastava.123

New User


Joined: 29 Jun 2014
Posts: 16
Location: India

PostPosted: Thu Aug 07, 2014 8:15 pm
Reply with quote

Hi All,

I am trying to read Hex values i.e. convert HEX to actual character in file.

I found below explanation but I am not able to apply it.
i.e. I want to understand the math i.e. how is F0 corresponds to 0 F1 corresponds to F1.

Explanation:
In these cases you have to split the byte string and place every second hex value in the top line and the other in the bottom line. With HEX DATA this problem is no problem any more. Imagine this display of a record 14 bytes long in HEX ON:

Code:

0123456789
--------------
FFFFFFFFFF2010
01234567890426


After issuing HEX DATA it looks like this instead:


Code:
0123456789
--------------
F0F1F2F3F4F5F6
F7F8F920041206


Regards,
Ashish
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Thu Aug 07, 2014 8:36 pm
Reply with quote

Quote:
.e. I want to understand the math i.e. how is F0 corresponds to 0 F1 corresponds to F1.


there is no math involved it' s the convention enforced by the EBCDIC <encoding>
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Thu Aug 07, 2014 8:59 pm
Reply with quote

HEX will display bytes in "vertical" format by default. HEX DATA displays the same characters in "horizontal" format. See the explanations in the ISPF Tutorial.
Code:
 MNPC#1    XXXXXX.ALL256.HEX.CHAR                     Line 00000001 Col 001 080
 Command ===> hex                                              Scroll ===> CSR
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
----+----F----+----F----+----F----+----F----+----F----+----F----+----F----+----F
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
 ------------------------------------------------------------------------------
................................................................
00000000000000001111111111111111222222222222222233333333333333334444444444444444
0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0000000000000000
 ------------------------------------------------------------------------------
 .........¢.<(+|&.........!$*);¬-/........¦,%_>?.........`:#@'="
44444444444444445555555555555555666666666666666677777777777777774444444444444444
0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0000000000000000
 ------------------------------------------------------------------------------
.abcdefghi.......jklmnopqr.......~stuvwxyz......................
88888888888888889999999999999999AAAAAAAAAAAAAAAABBBBBBBBBBBBBBBB4444444444444444
0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0000000000000000
 ------------------------------------------------------------------------------
{ABCDEFGHI......}JKLMNOPQR......\.STUVWXYZ......0123456789......
CCCCCCCCCCCCCCCCDDDDDDDDDDDDDDDDEEEEEEEEEEEEEEEEFFFFFFFFFFFFFFFF4444444444444444
0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0000000000000000


Code:
 MNPC#1    XXXXXX.ALL256.HEX.CHAR                     Line 00000001 Col 001 080
 Command ===> hex data                                         Scroll ===> CSR
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
--------++--------F1--------++--------F2--------++--------F3--------++--------F4
--------++--------F5--------++--------F6--------++--------F7--------++--------F8
 ------------------------------------------------------------------------------
................................................................
000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F2021222324252627
28292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F40404040404040404040404040404040
 ------------------------------------------------------------------------------
 .........¢.<(+|&.........!$*);¬-/........¦,%_>?.........`:#@'="
404142434445464748494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F6061626364656667
68696A6B6C6D6E6F707172737475767778797A7B7C7D7E7F40404040404040404040404040404040
 ------------------------------------------------------------------------------
.abcdefghi.......jklmnopqr.......~stuvwxyz......................
808182838485868788898A8B8C8D8E8F909192939495969798999A9B9C9D9E9FA0A1A2A3A4A5A6A7
A8A9AAABACADAEAFB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBF40404040404040404040404040404040
 ------------------------------------------------------------------------------
{ABCDEFGHI......}JKLMNOPQR......\.STUVWXYZ......0123456789......
C0C1C2C3C4C5C6C7C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7D8D9DADBDCDDDEDFE0E1E2E3E4E5E6E7
E8E9EAEBECEDEEEFF0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF40404040404040404040404040404040
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Aug 07, 2014 9:27 pm
Reply with quote

There are examples here of converting binary data to its character representation. Which is most useful to you, we can only guess, as you've not said what you want to do with it. One of Mr Bill's (Bill O'Boyle) conversions using packed-decimal definitions gives you quick results. Click on the Search at the top of the page.
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2546
Location: Silicon Valley

PostPosted: Fri Aug 08, 2014 2:00 am
Reply with quote

Quote:
I am trying to read Hex values i.e. convert HEX to actual character in file.


I think you are doing it backwards (or at least, your question is not worded correctly).

No conversion is necessary. The ISPF editor is already showing you the 'actual character in file'. But the file may have binary data as well as character data. For example, one character field may have a street address such as '123 Fake Street', but the 123 is not a numeric value. It is a character representation of the number. Internally, it is represented as a hex value of 'F1F2F3'x.

The file may also contain numeric fields which can be seen with HEX DATA command. A decimal value of 123 will be shown in its hex form of '00000007B'x and would be represented in the editor by the characters ' #'C. Where the leading zeroes do not represent a printable character.

If you see something like: '00000007B'x and want the decimal equivalent, it is best to use a hex calculator to do the conversion.
Back to top
View user's profile Send private message
steve-myers

Active Member


Joined: 30 Nov 2013
Posts: 917
Location: The Universe

PostPosted: Fri Aug 08, 2014 6:52 am
Reply with quote

I agree with Pedro. ISPF does pretty well with character data, less well if the data is a mixture, for example -
Code:
.Ø.....-USERNAME........QSORTL  ...µ....MINIFMT .......°CNVTBIN ...ì....QSORTS 
س..............................................................................
Ø..5695PMB01 ....¤.ec"                                                         
Ø.dØ..569623400 ....¤Ø..569623400 ....¤Ø..569623400 .....                       
............ ..½.......°...8                                                   
å00..USERNAME.°Ö}..õ 0I.&}0.&0}..ÿì...ç&...íxM...&à&{¢xÈ..à&{&|.}.&.ô@x4..ù...F.
.......à...............h...ð...°...r...¸...~...v...z...Ý........... .......à....


Code:
 ------------------------------------------------------------------------------
.Ø.....-USERNAME........QSORTL  ...µ....MINIFMT .......°CNVTBIN ...ì....QSORTS 
28000006EECDDCDC00000003DEDDED44001A0000DCDCCDE400030009CDEECCD400150000DEDDEE44
0000010042595145000000E082693300309070054959643000E0F0A0355329503088700382693200
 ------------------------------------------------------------------------------
س..............................................................................
8F000000000000000000000000000000000000000000000000000000000000000000000000000000
0A100000000000000000000000000000000000000000000000000000000000000000000000000000
 ------------------------------------------------------------------------------
Ø..5695PMB01 ....¤.ec"                                                         
810FFFFDDCFF4001290887                                                         
05256957420101641F153F                                                         
 ------------------------------------------------------------------------------
Ø.dØ..569623400 ....¤Ø..569623400 ....¤Ø..569623400 .....                       
838800FFFFFFFFF400129800FFFFFFFFF400119800FFFFFFFFF400110                       
08401056962340001541F03056962340001507F05056962340001505F                       
 ------------------------------------------------------------------------------
............ ..½.......°...8                                                   
000000000000401B00030009000F                                                   
10010C00600000A801E003A00518                                                   
 ------------------------------------------------------------------------------
å00..USERNAME.°Ö}..õ 0I.&}0.&0}..ÿì...ç&...íxM...&à&{¢xÈ..à&{&|.}.&.ô@x4..ù...F.
4FF00EECDDCDC09ED01C4FC25DF05FD01D5310453015AD010545C4A70145C540D150C7AF00D030C2
700E84259514500C0C8F1098000400088F8000800025740560400A74004000F00000BC7408D00268
 ------------------------------------------------------------------------------
.......à...............h...ð...°...r...¸...~...v...z...Ý........... .......à....
0000000400000000000000080008000900090009000A000A000A000A000300001004000010040000
E0000004000000000101D0B8D0BCD0B090B990BD90B190B590B990BD80C10201C0D00301C0D40505
This is a load module. The first line is part of data area called a CESD. The text starting with USERNAME is the start of a 16 byte entry. The last 2 byes are binary data, 0E30, but it's difficult to read the way ISPF presents it. As Pedro says, it's much easier to convert it to decimal using some sort of hexadecimal calculator.

Similarly, the second to last line is part of the program text. The first 4 bytes are (in "regular" hexadecimal) 47F0F00E, which an Assembler programmer will immediately recognize is a branch instruction., but it's very hard to read it the way ISPF presents it. Something like
Code:
0000     0  47F0F00E 08E4E2C5  D9D5C1D4 C50090EC  *.00..USERNAME...*
0010    16  D00C18CF 41F0C928  50D0F004 50F0D008  *.....0I.&.0.&0..*
0020    32  18DF5830 10004850  30001255 A7D40015  *.......&....xM..*
0030    48  06504450 C04AA774  00104450 C0504F00  *.&.&.¢x....&.&|.*
0040    64  D0105000 CB7CA7F4  0008DD00 3002C628  *..&..@x4......F.*
is much easier to read. On the other hand, a similar presentation,
Code:
0000     0  C1C2C3F1 F2F34040  818283F1 F2F34040  *ABC123  abc123  *
0010    16  40404040 40404040  40404040 40404040  *                *
            ONE OR MORE LINES SAME AS PREVIOUS LINE                 
0040    64  40404040 40404040  40404040 40404040  *                *
is much less useful for character data. While its far from impossible, connecting 818283F1F2F3 to abc123 is slightly difficult.
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 -> TSO/ISPF

 


Similar Topics
Topic Forum Replies
No new posts Error to read log with rexx CLIST & REXX 11
No new posts Random read in ESDS file by using RBA JCL & VSAM 6
No new posts VSAM return code 23 - for a Random read COBOL Programming 4
No new posts ICETOOL to Read records SMF CEF it is... DFSORT/ICETOOL 4
No new posts Read a flat file and update DB2 table JCL & VSAM 2
Search our Forums:

Back to Top