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 

difference between EBCDIC and HEXADECIMAL for character

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
mfuser
Banned


Joined: 01 Mar 2005
Posts: 105
Topics: 58

PostPosted: Sat Jul 08, 2006 5:21 am    Post subject: difference between EBCDIC and HEXADECIMAL for character Reply with quote

Members,

I have a column called FIXTYPE CHAR(01) and has a value 'B'.When i try to get the HEX value of FIXTYPE i am getting as
Code:

SELECT HEX(FIXTYPE) FROM TABLENAME;

OUTPUT:
Code:

C2

Wheras i am reading a doc for SQL Reference which says
Code:

Suppose COL_1 is a column with a data type of char(1) and a value of 'B'.
The hexadecimal representation of the letter 'B' is X'42'. HEX(COL_1)
returns a two-character string '42'.


Why is that i am not getting as '42' output instead i am getting 'C2'.

In the links provided

APPENDIX1.3.1 EBCDIC collating sequence
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/IGY3LR10/APPENDIX1.3.1?SHELF=&DT=20020920180651&CASE=

APPENDIX1.3.2 US English ASCII code page (ISO 646)
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/IGY3LR10/APPENDIX1.3.2?SHELF=&DT=20020920180651&CASE=

Which link we should refer and how should i check for the letter B the equivalent Hexadecimal value as 42 because there are two links which have letter B which is mentioned.Is it that since Mainframes uses EBCDIC , so we have to consider EBCDIC letter B is equivalent to 'C2' then when should be the case for considering '42'.Please help me understand the basics.
Back to top
View user's profile Send private message
semigeezer
Supermod


Joined: 03 Jan 2003
Posts: 1014
Topics: 13
Location: Atlantis

PostPosted: Sat Jul 08, 2006 7:57 am    Post subject: Reply with quote

Was the reference material for an ASCII Platform?
Back to top
View user's profile Send private message Visit poster's website
videlord
Beginner


Joined: 09 Dec 2004
Posts: 147
Topics: 19

PostPosted: Sat Jul 08, 2006 11:38 am    Post subject: Reply with quote

the hex code value depend on the CCSID of the table definition
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 -> Database 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