15 pts.
 Character delimited csv with double byte data

I have a physical file on the iSeries (V7R1) that I am trying to send to the IFS using CPYTOIMPF. When I open the file on the IFS using Excel I expected to be able to parse the data using "Text to Columns" but the delimiter characters are missing and the text is garbled. Several of the fields contain double byte characters. They are defined with data type "O" (open) and CCSID 65535.

I've tried several combinations of data type and CCSID but all I get is unreadable ASCII text. By the way, I'm trying to use a Japanese character set.

Can anyone lead me through this maze?

Thanks in advance for your assistance.



Software/Hardware used:
iSeries V7.R1, Excel 2007, iSeries Client Access for Windows vsn.6
ASKED: August 3, 2012  2:50 PM

Answer Wiki:
Last Wiki Answer Submitted:  Be the first to answer this question.
All Answer Wiki Contributors:  Be the first to answer this question.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

I don’t KNOW that CPYTOIMPF can’t be setup to handle it properly, but I do know that I have only seen Japanese DBCS handled successfully by using CPYTOPCD with the TRNIGC(*JPN) option specified which creates a file in the QDLS folders.  This file was then moved to an IFS directory and used from there. 

 7,185 pts.

 

I also don’t know it can’t be done. With little experience to go on and no experimentation, I can think of three things that might relate.
 

First, it can’t work. By definition, the .CSV format doesn’t handle DBCS. The file format is defined as a container for basic text. It doesn’t know about mixed-byte forms where delimiters and some columns are encoded differently than other columns.
If it can work, it must be created as a UTF-16 file. That’s what Excel should support.
To get it readable in Excel, use the Excel File->Open dialog. Don’t double-click, don’t use Windows Explorer, and don’t drag/drop. The interpretation of how to handle the byte encodings sometimes seems to happen only when processed through the right code paths.
 
Those are all “quick thoughts” possibilities, not actual results of testing. But they do have some technical background.
 
Tom

 107,995 pts.