× 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.



Buck: I got better characters using the SED program but still not right.
I'm using a MAC and I am wondering if it's causing a problem. Coworker on
windows was able to open my CSV and it was OK.

On Thu, Aug 1, 2024 at 11:22 AM Buck Calabro <kc2hiz@xxxxxxxxx> wrote:

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 (张)

--
--buck

http://wiki.midrange.com
Your updates make it better!


--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.



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.