MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Convert hex to character

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
Pudah
Beginner


Joined: 20 Jun 2003
Posts: 27
Topics: 8
Location: East of the Rock, West of the Hard Place

PostPosted: Sat Aug 14, 2004 11:04 am    Post subject: Convert hex to character Reply with quote

I have searched the forum but haven't been able to find this topic covered.

Say I have a field XL1'D3'. I want to convert it to CL2'D3'. Is there a way to do this in assembler?
Back to top
View user's profile Send private message Send e-mail
Mervyn
Moderator


Joined: 02 Dec 2002
Posts: 415
Topics: 6
Location: Hove, England

PostPosted: Sat Aug 14, 2004 3:30 pm    Post subject: Reply with quote

I think this will do it. Try it, and let us know:

Code:


         MVC   OUTFIELD(1),INFIELD
         MVC   OUTFIELD+1(1),INFIELD
         TR    OUTFIELD(1),TABLE1
         TR    OUTFIELD+1(1),TABLE2
 
 
 
 
 
INFIELD  DC    X'D3'
OUTFIELD DS    CL2
TABLE1   DC    16C'0',16C'1',16C'2',16C'3'
         DC    16C'4',16C'5',16C'6',16C'7'
         DC    16C'8',16C'9',16C'A',16C'B'
         DC    16C'C',16C'D',16C'E',16C'F'
TABLE2   DC    16C'0123456789ABCDEF'




Check out this manual:

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/DZ9ZR003/CCONTENTS?DT=20040504121320
_________________
The day you stop learning the dinosaur becomes extinct
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Mon Aug 16, 2004 5:59 am    Post subject: Reply with quote

Pudah,

Please search before posting. A simple search for "HEX CHARACTER" yielded the following.

http://www.mvsforums.com/helpboards/viewtopic.php?t=2351&highlight=hex+character

http://www.mvsforums.com/helpboards/viewtopic.php?t=2564&highlight=hex+character

http://www.mvsforums.com/helpboards/viewtopic.php?t=2592&highlight=hex+character

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Mervyn
Moderator


Joined: 02 Dec 2002
Posts: 415
Topics: 6
Location: Hove, England

PostPosted: Mon Aug 16, 2004 9:14 am    Post subject: Reply with quote

None of those links actually solves the problem, which is about converting a byte to printable hex characters using Assembler.
_________________
The day you stop learning the dinosaur becomes extinct
Back to top
View user's profile Send private message
Pudah
Beginner


Joined: 20 Jun 2003
Posts: 27
Topics: 8
Location: East of the Rock, West of the Hard Place

PostPosted: Tue Aug 17, 2004 4:11 pm    Post subject: Reply with quote

Quote:
None of those links actually solves the problem, which is about converting a byte to printable hex characters using Assembler.

Mervyn is correct. I had done a search and found those threads. But none of them discussed assembler.

And I did try your code suggestion Mervyn, and it worked like a charm. Thanks a bunch. I still need to ponder the TABLE1 entries though, because I'm not clear on why it works. I'll look thru that manual you linked to and see if I can get a clearer picture on what's going on.

Thanks again!
Back to top
View user's profile Send private message Send e-mail
Mervyn
Moderator


Joined: 02 Dec 2002
Posts: 415
Topics: 6
Location: Hove, England

PostPosted: Tue Aug 17, 2004 5:33 pm    Post subject: Reply with quote

Superb. The Principles of Operation manual will teach you more than I ever could.
_________________
The day you stop learning the dinosaur becomes extinct
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group