× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



On 8/1/2024 9:17 AM, Art Tostaine, Jr. wrote:
I can't get a table with CCSID 1208 to the IFS. I created a table and
put this column in there, defined as 1208: ADD1 CHAR
60 62 34 Both Address 1 Coded Character Set
Identifier . . . . . : 1208 UCS2 or Unicode conversion . . . . .
. . : *CONVERT

I inserted a row using IBM iACS: *insert* into intlzu00
(filekey,filetype,add1) values(*8998055*,'PTIST00','Zhang (张)');

I can see the characters when I do a select in iACS. When I do a
select in STRSQL I can see a reverse image character. When I write
the file to the IFS I see a blank instead of the character.

I can't get the character to the IFS using CPYTOIMPF. I've tried
every CCSID I could think of. Any ideas?

tl;dr I think you have a Byte Order Mark issue.


I'm on 7.4, QCCSID 37, job CCSID 37.
I tried recreating your environment:
In ACS:
create table buck.art (add1 char(60) ccsid 1208);
insert into buck.art (add1) values('Zhang (张)');
select * from buck.art;
result: Zhang (张)
select hex(add1) from buck.art;
result: 5A68616E672028E5BCA02920202020...

In a 5250 job CCSID 37:
CPYTOIMPF FROMFILE(BUCK/ART)
TOSTMF('/home/buck/art.csv')
STMFCCSID(1208)
RCDDLM(*CRLF)

Using Windows File Explorer:
Navigate to /home/buck
Edit art.csv in Notepad++
result: "Zhang (张)...

Double click and open with Excel:
result: Zhang (å¼ )

I think that you are fighting the inconsistent implementation of UTF-8 across various platforms and applications. This implementation is often aided by adding Byte Order Marks (BOM) as the first few characters of a file. In the case of UTF-8, that BOM is x'EFBBBF'.

Let's add the BOM using bash:
sed 's/^\(.*\)$/\xef\xbb\xbf\1/g' art.csv > artutf8.csv
...and open that with a double click to get Excel to view it:
result: Zhang (张)


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.