Chuck,
Your advice was, again, spot on.
The following command solved the conversion problem:
CHGATR OBJ('/mydir/myfile.txt') ATR(*CCSID) VALUE(1200)
Joe, hope this helps you as well.
I did try CCSID 1201 which returned:
File system error occurred. Error number 3490.
Detail for CPE3490:
One or more characters could not be converted from the
source CCSID to the target CCSID.
Comparing the IBM documentation on the two CCSID reveals
little, except that
CCSID 1200 is "UTF-16 BE with IBM PUA"
and
CCSID 1201 is "UTF-16 BE"
Apparently "IBM PUA" has the stuff:
"PUA of the BMP is IBM default in the last 256 code positions
and generic UDSs in all other code positions."
John, maybe I can get some Python in my future so I don't
get bit by these crazy bytes . . . back to work now
-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of CRPence
Sent: Tuesday, April 09, 2013 7:56 PM
To: midrange-l@xxxxxxxxxxxx
Subject: Re: CPYFRMIMPF FROMCCSID(1201)
On 09 Apr 2013 16:37, Gary Thompson wrote:
My first attempt at "consuming" a .txt file in, I think, Unicode
format did not work as expected.
CPYFRMIMPF did copy the data to the local EBCDIC file, but the data
was still "double byte" (an "extra" space between each character).
I tried both
FROMCCSID(1201)
FROMCCSID(1200)
CCSID is described as UTF-16 BE and it seems to be a Windows
"standard" for text files.
AFaIK the FROMCCSID parameter applies to the FROMFILE, not the FROMSTMF [¿unless the FROMSTMF CCSID is 65535?]. See the doc link after the two archived message links. If the results are not as described, e.g. no error when the /from-file/ [as FROMSTMF] is not *HEX, then either report the contradiction with the effects and the doc as a defect.
Note: I do not know anything about CCSID(1201), I know only of
CCSID(1200) as UNICODE UTF-16BE. There is no mention of 1201 here:
http://pic.dhe.ibm.com/infocenter/iseries/v7r1m0/topic/rzaha/fileenc.htm
Correctly tag the CCSID for the FROMSTMF [e.g. CHGATR], and the problem will be resolved; well, it has always worked for me anyhow, since v5r3. For example, as described in the recent messages:
http://archive.midrange.com/midrange-l/201303/msg00039.html
"... The CCSID for the FROMSTMF is always the CCSID of the STMF. Thus if the stream files are improperly tagged, then improper effects are to be expected. To correct the CCSID tagging, use the following request:
CHGATR OBJ(the_file) ATR(*CCSID) VALUE(1200) ..."
http://archive.midrange.com/midrange-l/201303/msg00084.html
"... Again, that issue [almost positively] is due to the incorrect tagging; i.e. wrong CCSID. When the STMF is tagged with something other than 1200 but its data is UTF-16BE, then the copy feature does not work.
So if the file is incorrectly tagged with CCSID-1252 or CCSID-819, then CPYFRMSTMF does not know you lied, and tries to convert the data based on that lie, then the effect will *appear to be* byte-by-byte conversion. That is because the feature has no idea that the data is two-byte characters, when the CCSID says they are not. Unlike the CPYFRMIMPF however, the STMFCCSID [or STMFCODPAG on older releases] can be used to override the STMF CCSID to 1200" <ed: addendum:> on the CPYFRMSTMF command.
http://pic.dhe.ibm.com/infocenter/iseries/v7r1m0/topic/cl/cpyfrmimpf.htm
_i Copy From Import File (CPYFRMIMPF) i_ "The Copy From Import File (CPYFRMIMPF) command copies all or part of an import file to the TOFILE. The term import file is used to describe a file created for purposes of copying data between heterogeneous databases. The import file (FROMSTMF or FROMFILE parameter) is called the from-file for this command.
...
From CCSID (FROMCCSID)
Specifies the coded character set identifier (CCSID) of the from-file.
*FILE
The from-file CCSID is used. If the from-file is a tape file, the job's default CCSID is used.
1-65533
Specify the CCSID to be used when the CCSID of the from-file is 65535, or if the from-file is a tape file. If the from-file CCSID is not 65535, or the from-file is not a tape file, an error message will be sent.
..."
--
Regards, Chuck
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at
http://archive.midrange.com/midrange-l.
As an Amazon Associate we earn from qualifying purchases.