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
 
Convert a 2 Byte HEX value into a 3 Byte Alphanumeric value

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

New User


Joined: 30 May 2007
Posts: 10
Location: Mumbai

PostPosted: Wed May 30, 2007 4:24 pm    Post subject: Convert a 2 Byte HEX value into a 3 Byte Alphanumeric value
Reply with quote

Hi All,

I need to convert a 2 Byte HEX value into a 3 Byte Alphanumeric value

Please help me on the same.

For example my input is hex'C1C2'

I need to display it in 3 byte alphanumeric like ' AB'
Back to top
View user's profile Send private message

agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 686
Location: Earth

PostPosted: Wed May 30, 2007 5:01 pm    Post subject: Re: HEX TO ALPHANUMERIC CONVERSION
Reply with quote

what is the problem in this?
if you have x'c1c2' two bytes, what is the defn of this?
if x(02) then move it to x(03) justified right and display.
Back to top
View user's profile Send private message
SyntelShinto

New User


Joined: 30 May 2007
Posts: 10
Location: Mumbai

PostPosted: Thu May 31, 2007 8:54 am    Post subject: Re: HEX TO ALPHANUMERIC CONVERSION
Reply with quote

Hi Abhijit,

I think i mentioned worngly, My requirement is to convert the HEX value into the corresponding Decimal value and display it.

Like if we are passing X'FF' it should convert to decimal equivalent of 255.


Could you please suggest,
Back to top
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 686
Location: Earth

PostPosted: Thu May 31, 2007 11:54 am    Post subject:
Reply with quote

Looks like a totally new question to me, but still, where is the problem?
try this-
Code:
77 hex-var pic x(02) value x'00ff'.
77 num-var redefines hex-var pic 9(04) comp.

display num-var.
Back to top
View user's profile Send private message
SyntelShinto

New User


Joined: 30 May 2007
Posts: 10
Location: Mumbai

PostPosted: Thu May 31, 2007 12:40 pm    Post subject:
Reply with quote

Thanks Abhijit Now i got it ....,
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 Can EDCICONV convert EBCDIC to ASCII... natt.sut IBM Tools 3 Fri Nov 17, 2017 8:46 pm
This topic is locked: you cannot edit posts or make replies. Can a alphanumeric data be moved to a... nico_neoz COBOL Programming 10 Mon Oct 30, 2017 8:28 am
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 Convert rows and column into JSON for... Dinesh Manivannan DB2 2 Sun Sep 03, 2017 6:50 pm
No new posts Convert CLIST to REXX cvnlynn CLIST & REXX 12 Tue Jun 27, 2017 2:06 am

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