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

Unicode conversion from Little Endian to Big Endian.


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

New User


Joined: 09 Apr 2007
Posts: 2
Location: India

PostPosted: Mon Apr 09, 2007 9:18 pm
Reply with quote

Hi there,
I am trying to process a Unicode data file received from windows. Found out that the file received is of Unicode LE (Little Endian) form, and before processing it has to be converted into BE (Big Endian) form.

My task is now to convert this file to Big Endian form so that I can use my COBOL code to complete the process.
In the net I got the formulae for conversion, but, it is provided in C code.
long wc;
wc = (wc >> 8) | ((wc % 256) << 8);
I am trying to code this in COBOL on Z/OS platform.
Can any one suggest how this can be achieved using COBOL.

Thanks
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Apr 10, 2007 1:15 am
Reply with quote

Hello,

If you can, convert the file(s) on the win-based system and re-transmit.

If you can't, find or create the conversion chart, set up a couple of arrays for "little" and "big", and convert pair by pair.
Back to top
View user's profile Send private message
giridhar_vinta

New User


Joined: 09 Apr 2007
Posts: 2
Location: India

PostPosted: Tue Apr 10, 2007 2:13 pm
Reply with quote

Hi,

Can you provide little more details like where I can get these conversion byte info. for the Little Endian to big endian? I did try the Unicode site, they must be there, I couldn't get it.

For my testing I did do the conversion to big-endian in windows and going ahead with it. But for production that wouldn't work, as the file transmitted to my process is again re-transmitted to another system for processing, I cannot change the file contents in any way.

Any suggestions?

Thanks,
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 Assembler class assignment: stuck on ... PL/I & Assembler 12
Search our Forums:

Back to Top