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

HEX to ASCII conversion


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
stalin.i@gmail.com

New User


Joined: 18 Apr 2005
Posts: 8
Location: chennai

PostPosted: Sun Apr 09, 2006 8:00 am
Reply with quote

Can any one coded direct ASCII to COBOL conversion routines.

I prefer to do this using COBOL only. Please explain the logic briefly.

If you have assembler code for direct HEX to ASCII conversion. Please make it available to me.

Cheers,
Back to top
View user's profile Send private message
dneufarth

Active User


Joined: 27 Apr 2005
Posts: 419
Location: Inside the SPEW (Southwest Ohio, USA)

PostPosted: Sun Apr 09, 2006 8:44 am
Reply with quote

do you mean EBCDIC to ASCII?
Back to top
View user's profile Send private message
stalin.i@gmail.com

New User


Joined: 18 Apr 2005
Posts: 8
Location: chennai

PostPosted: Sun Apr 09, 2006 9:46 pm
Reply with quote

no Dave. I want to convert HEX to ASCII conversion using COBOL or ASSEMBLER. I will be very happy if you can give me the logic or code or Both.

Thanks for your response.
Back to top
View user's profile Send private message
dneufarth

Active User


Joined: 27 Apr 2005
Posts: 419
Location: Inside the SPEW (Southwest Ohio, USA)

PostPosted: Sun Apr 09, 2006 11:51 pm
Reply with quote

I'm confused; give us an example.

x'30' is 0 in ascii, so how would you expect to convert it?

x'F0' (0 IN EBCDIC) would become x'30' (0 in ASCII)
Back to top
View user's profile Send private message
stalin.i@gmail.com

New User


Joined: 18 Apr 2005
Posts: 8
Location: chennai

PostPosted: Mon Apr 10, 2006 11:30 pm
Reply with quote

input in hex "41414141'
output in ebcedic "AAAA"

I want to convert any given HEX value to equivalent EBCEDIC value
Back to top
View user's profile Send private message
stalin.i@gmail.com

New User


Joined: 18 Apr 2005
Posts: 8
Location: chennai

PostPosted: Mon Apr 10, 2006 11:32 pm
Reply with quote

Sorry Dave, I am little confused now. I will post a clear example later. icon_smile.gif
Back to top
View user's profile Send private message
dneufarth

Active User


Joined: 27 Apr 2005
Posts: 419
Location: Inside the SPEW (Southwest Ohio, USA)

PostPosted: Tue Apr 11, 2006 3:38 am
Reply with quote

sounds like you want an ASCII to EBCDIC conversion.

INSPECT REPLACING is the COBOL command

TR is the assembler op code

see the specific language ref manual

publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/igy3lr30/6.2.21?SHELF=&DT=20050714120224&
Back to top
View user's profile Send private message
dneufarth

Active User


Joined: 27 Apr 2005
Posts: 419
Location: Inside the SPEW (Southwest Ohio, USA)

PostPosted: Tue Apr 11, 2006 6:46 am
Reply with quote

TR info is here publibz.boulder.ibm.com/epubs/pdf/a2278324.pdf
Back to top
View user's profile Send private message
stalin.i@gmail.com

New User


Joined: 18 Apr 2005
Posts: 8
Location: chennai

PostPosted: Tue Apr 11, 2006 9:40 pm
Reply with quote

Dave,

I used a existing assembler routines to do the job. Its works well. Thanks for all your sugessions.

I do have the EBCEDIC-ASCII table with me. I did not go for the inspect method because some valid HEX values do not have a equivalent EBCEDIC values.

Thanks again.
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sat Apr 15, 2006 10:55 pm
Reply with quote

P.S. There are no invalid HEX values.
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 -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts 10 byte RBA conversion DB2 2
No new posts 10 byte RBA conversion -non applicati... JCL & VSAM 1
No new posts file manager is doing string conversion IBM Tools 3
No new posts Converting ASCII values to COMP-3 (ZD... JCL & VSAM 2
No new posts SMF Record Date conversion failing CLIST & REXX 1
Search our Forums:

Back to Top