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

PC (UTF-8) -> z/OS (EBCDIC) -> PC (UTF-8), aligned in table


IBM Mainframe Forums -> All Other Mainframe Topics
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
prino
Warnings : 1

Senior Member


Joined: 07 Feb 2009
Posts: 1238
Location: Vilnius, Lithuania

PostPosted: Fri Sep 01, 2017 1:47 am
Reply with quote

Scenario:

There is a file, encoded in UTF-8 on Windoze. FTP'ing it to z/OS will translate normal ASCII into normal EBCDIC, and UTF-8 into "gibberish", but the transfer back to the PC will un-gibberize this gibberish nicely back to UTF-8, so that's not the problem.

The problem is that on z/OS I don't not know the real length of the gibberish as UTF-8 data, unless I actually start scanning for the translated-to-gibberish first UTF-8 characters, and use a translate table to establish the length of the UTF-8 character in bytes, because

the output is a table where the borders are made up of +/-/| characters, and they need to be aligned when the file is later re-opened on the PC, and obviously ä in EBCDIC (aka ä in UTF-8) have different lengths, and just willy-nilly putting '|'s in column xxx after 42 bytes of data will not really result in a nice table on the PC.

Any suggestions?
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1689
Location: Tiruppur, India

PostPosted: Fri Sep 01, 2017 5:16 am
Reply with quote

You can take your gibberish description of the problem without any data to the recycle bin where it belongs.
Back to top
View user's profile Send private message
prino
Warnings : 1

Senior Member


Joined: 07 Feb 2009
Posts: 1238
Location: Vilnius, Lithuania

PostPosted: Sat Sep 02, 2017 1:02 am
Reply with quote

vasanthz wrote:
You can take your gibberish description of the problem without any data to the recycle bin where it belongs.


Code:

| Süd | Sud  |
| Nord | Nord |

Nice aligned on z/OS. Now, in this case, ind$file back to PC, display in a UTF-8 aware editor and you'll get

Code:

| Süd | Sud  |
| Nord | Nord |

Bye-bye alignment.
Back to top
View user's profile Send private message
prino
Warnings : 1

Senior Member


Joined: 07 Feb 2009
Posts: 1238
Location: Vilnius, Lithuania

PostPosted: Mon Sep 04, 2017 12:38 am
Reply with quote

Solved it, for this particular case, by adding an extra comment-type line to the PC file, containing the 224 ASCII characters from 0x20 (space) to 0xff. In PL/I this will allow the simple combination of translate() + sum() determine the number of UTF-8 characters.
Back to top
View user's profile Send private message
prino
Warnings : 1

Senior Member


Joined: 07 Feb 2009
Posts: 1238
Location: Vilnius, Lithuania

PostPosted: Mon Sep 04, 2017 12:53 am
Reply with quote

And for what it's worth, the method doesn't care about the method of transferring the PC file to a z/OS dataset, be it IND$FILE or FTP, provided the transfer is strictly one-to-one.
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 -> All Other Mainframe Topics

 


Similar Topics
Topic Forum Replies
No new posts XYplorer - EBCDIC to ASCII translatio... All Other Mainframe Topics 0
No new posts Need to read duplicate rows from tabl... DB2 3
No new posts EBCDIC to ASCII conversion help All Other Mainframe Topics 1
No new posts EBCDIC (0037) to/from UTF-8 (1208) CLIST & REXX 2
No new posts Hex Table COBOL Programming 2
Search our Forums:

Back to Top