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: 1048
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: 1521
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: 1048
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: 1048
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: 1048
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 Insert a Row_number into table useit DB2 2 Tue Sep 19, 2017 1:07 pm
No new posts how to see when the last read access ... Mike 1304 DB2 1 Tue Sep 12, 2017 7:52 pm
No new posts Adding a userid to SMTP Security table Yolanda Harvey JCL & VSAM 1 Sun Aug 13, 2017 6:16 pm
No new posts Loading data to table gives wrong for... Raghu navaikulam DB2 19 Thu Jul 13, 2017 2:11 pm
No new posts unload data from table with lob columns farhad_evan DB2 1 Sat Apr 22, 2017 1:32 pm

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