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
 

 

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: 685
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: 685
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
This topic is locked: you cannot edit posts or make replies. How to move a long alphanumeric data ... lind sh COBOL Programming 8 Mon Dec 05, 2016 7:51 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts Convert +9999999999999.99 to S9(12)V9(3) vnktrrd DFSORT/ICETOOL 8 Thu Nov 17, 2016 8:15 pm
This topic is locked: you cannot edit posts or make replies. Db2 SQL query to convert rows into co... subratarec DB2 5 Thu Nov 17, 2016 4:51 pm
No new posts convert PD to ZD ram_vizag DFSORT/ICETOOL 5 Sat Nov 05, 2016 3:06 am


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