|
Brad, I would recommend changing over to O_CCSID from O_CODEPAGE. At http://www-03.ibm.com/servers/eserver/iseries/software/globalization/ccsid_list.html you can find the definitions of the various CCSIDs supported by i5/OS. If you look at CCSID 935 you will see that there are actually two code pages involved as 935 is an EBCDIC mixed SBCS/DBCS CCSID. The two code pages are 836 for the SBCS code points and 837 for the DBCS code points. There is no one O_CODEPAGE to represent this. Likewise CCSID 1381 is a PC-data mixed byte CCSID built on code page 1115 and 1380. Again there is no one O_CODEPAGE to represent this. When open() was initially introduced the only support was for O_CODEPAGE (and mixed byte encodings were not supported for mapping purposes). A few releases later open() was enhanced with O_CCSID in order to provide better support for mixed DBCS environments. Hope this helps, Bruce "Brad Stone" <brad@xxxxxxxxxxxx> Sent by: rpg400-l-bounces@xxxxxxxxxxxx 10/26/2006 10:21 AM Please respond to RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx> To RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx> cc Subject Re: "Conversion Error" when opening Stream File After looking into this further, it appears we're specifying to open the file with O_CODEPAGE and specifying 1381 for that value. Now, after reading the docs more closely, if you specify a code page, it will use that to find a CCSID. So, the problem could be that there is no code page 1381 and this makes an invalid CCSID causing this error. Now, I've tried to search for a table of code pages and their related CCSIDs, but not having much luck. Anyone know where this beast may be found? Thanks! Brad On Wed, 25 Oct 2006 22:04:29 -0500 "Brad Stone" <brad@xxxxxxxxxxxx> wrote:
This sort of falls back to the DBCS issues I'm having with a client. Anyhow, we have physical file containing all text, and a CCSID of 935. One field in the PF of type "O". The text contains some DBCS chinese characters. Now, we're trying to read this file and write it to a stream file using the IFS APIs. For the open API we're specifing a CCSID of 1381. But, on the open API call, we're getting a "Conversion error" message and the job fails. The error actually ows the line number of the error as the definition for the open API itself instead of the actual call, though. (odd, I thought it would have been on the call). Now, we've succesfully taken this PF and copied it to a stream file using CPYTOIMPF, and that works fine. We specify *STDASCII as the "to" CCSID and it automatically creates it as 1381. But, we need to use a program to do the conversion to a stream file because we do maniuplate some of the data as we're going through it. This generic "conversion error" is sort of driving me nuts, though, as I can't find any information on it except "the CCSID is invalid". Well, if CPYTOIMPF can do it, shouldn't I be able to? :) Thanks for any assistance with this. -- This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/rpg400-l or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l.
Bradley V. Stone BVS.Tools www.bvstools.com
As an Amazon Associate we earn from qualifying purchases.
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.