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

UTF-8 to EBCDIC conversion


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
TS70363

New User


Joined: 07 Apr 2010
Posts: 94
Location: Bangalore, India

PostPosted: Wed Mar 07, 2012 5:37 pm
Reply with quote

Hi All,

I am using the below code to convert my input data in UTF-8 format to EBCDIC.

Code:
MOVE FUNCTION DISPLAY-OF (FUNCTION NATIONAL-OF   
             (UTF8-VARIABLE , 1208), 500)
                       TO EBCDIC-VARIABLE


It works fine for most of the input UTF-8 Characters. But the above piece of code does not convert X'E2809C' and X'E2809D' which actually should be opening and closing quotes in EBCDIC.

Could you please let me know, what could be the reason?

Is the compiler option correct? Or do I need to change the compiler option?
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8697
Location: Dubuque, Iowa, USA

PostPosted: Wed Mar 07, 2012 6:15 pm
Reply with quote

In looking at the EBCDIC 500 character set, I do not see either of the characters you're having problems with. Perhaps the problem is that there's nothing to convert them to?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Mar 07, 2012 6:21 pm
Reply with quote

Quote:
Is the compiler option correct? Or do I need to change the compiler option?


it is never the code,
it is always something else.

as robert said, insure that you are using the correct code page in
your line of code
which has nothing to do with the compiler or options
Back to top
View user's profile Send private message
Jose Mateo

Active User


Joined: 29 Oct 2010
Posts: 121
Location: Puerto Rico

PostPosted: Wed Mar 07, 2012 8:28 pm
Reply with quote

Good day to all!

Your system doesn't have code pages 1005 & 1156 in the graphic table definitions because 'E2809C' and 'E2809D' are in these code pages.
Back to top
View user's profile Send private message
TS70363

New User


Joined: 07 Apr 2010
Posts: 94
Location: Bangalore, India

PostPosted: Wed Mar 07, 2012 9:51 pm
Reply with quote

Hi..

Could you please let me know what should be the changes to my code?

Also can you please let me know what is the purpose of CODE PAGE.
Back to top
View user's profile Send private message
TS70363

New User


Joined: 07 Apr 2010
Posts: 94
Location: Bangalore, India

PostPosted: Wed Mar 07, 2012 10:00 pm
Reply with quote

Hi..

I have few set of UTF8 characters -

X'E28093' - represents a hyphen
X'E28099' - represents an apostrophe
X'E2809C' - represents opening double inverted commas
X'E2809D' - represents closing double inverted commas
X'E282AC' - represents Euro sign.

Whenever this set of input is given, I get X'3F' in the output,

but I would like it to get converted to a valid set of EBCDIC characters.

Can you please let me know what could be wrong?
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Wed Mar 07, 2012 10:08 pm
Reply with quote

For the meaning of CODE PAGE within a Cobol program, you should find sufficient explanations in the Language Reference and Programming Guide. You'll get it better if you do the reading yourself. If still unclear, explain what you understand, and what you don't.
Back to top
View user's profile Send private message
TS70363

New User


Joined: 07 Apr 2010
Posts: 94
Location: Bangalore, India

PostPosted: Wed Mar 07, 2012 10:51 pm
Reply with quote

Can you please let me know the code changes?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Mar 07, 2012 10:55 pm
Reply with quote

TS70363 wrote:
Can you please let me know the code changes?


Check this post: ibmmainframes.com/about30851.html
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 SMF Record Date conversion failing CLIST & REXX 1
No new posts EBCDIC and ASCII CICS 7
Search our Forums:

Back to Top