Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Converting ALPHANUMERIC DATA into HEXA DECIMAL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
srikanth_ponnapalli

New User


Joined: 17 Aug 2006
Posts: 1
Location: bangalore

PostPosted: Mon Feb 26, 2007 5:06 pm    Post subject: Converting ALPHANUMERIC DATA into HEXA DECIMAL
Reply with quote

hi guys,

Can anyone explain me how to convert ALPHANUMERIC DATA into HEXA DECIMAL data format in an ENTERPRISE COBOL.Could you please send me a sample code if possible.





Regards


Srikanth Ponnapalli
Back to top
View user's profile Send private message

sdpk_ind

New User


Joined: 07 May 2006
Posts: 4

PostPosted: Mon Feb 26, 2007 6:12 pm    Post subject: Re: Regarding Data Conversion
Reply with quote

if the data is in a dataset, then put 'hex on' in the command line to convert from alphanumeric to hexadecimal and 'hex off' to change it to alphanumeric.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Mon Feb 26, 2007 7:08 pm    Post subject:
Reply with quote

Code:
05  numbytes pic 99 comp
05  dispbytes redefines
    numbytes.
    10  twobyte pic x.
    10  onebyte pic x.
move low-values to twobyte.
move 'A' to onebyte.
multiply numbytes by 16.
inspect onebyte converting
    from X'00102030405060708090A0B0C0D0E0F0'
      TO X'F0F1F2F3F4F5F6F7F8F9C1C2C3C4C5C6'.
inspect twobyte converting
    from X'000102030405060708090A0B0C0D0E0F'
      TO X'F0F1F2F3F4F5F6F7F8F9C1C2C3C4C5C6'.
display dispbytes.>>>>>>>>>"C1"
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 Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts Extend the decimal values in DIVISION Balaryan DFSORT/ICETOOL 3 Thu Oct 05, 2017 4:05 pm
No new posts opening a dataset after reading it fr... arunsoods DFSORT/ICETOOL 5 Wed Oct 04, 2017 3:54 pm
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us