Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
PC (UTF-8) -> z/OS (EBCDIC) -> PC (UTF-8), aligned in table

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics
View previous topic :: :: View next topic  
Author Message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1113
Location: Oostende, Belgium

PostPosted: Fri Sep 01, 2017 1:47 am    Post subject: PC (UTF-8) -> z/OS (EBCDIC) -> PC (UTF-8), aligned in table
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: 1573
Location: Chennai

PostPosted: Fri Sep 01, 2017 5:16 am    Post subject:
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

Senior Member


Joined: 07 Feb 2009
Posts: 1113
Location: Oostende, Belgium

PostPosted: Sat Sep 02, 2017 1:02 am    Post subject:
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

Senior Member


Joined: 07 Feb 2009
Posts: 1113
Location: Oostende, Belgium

PostPosted: Mon Sep 04, 2017 12:38 am    Post subject:
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

Senior Member


Joined: 07 Feb 2009
Posts: 1113
Location: Oostende, Belgium

PostPosted: Mon Sep 04, 2017 12:53 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SQL IN predicate using COBOL table jerryte DB2 16 Fri Jun 29, 2018 10:30 pm
No new posts Extracting DDL for all list of intere... Ashishpanpaliya DB2 5 Mon May 21, 2018 4:08 pm
No new posts Searching a table for the field name? socker_dad COBOL Programming 8 Sat Mar 31, 2018 2:57 am
No new posts Need inputs on DB2 tablespace/table r... ashek15 DB2 3 Sat Mar 24, 2018 11:49 pm
No new posts COBOL declaration for table Poha Eater DB2 3 Mon Feb 26, 2018 6:58 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us