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



Hi Jim,

This symptom usually means that you marked the file with a CCSID of 819, but you wrote the data in EBCDIC. When that happens, the actual hex values of teh data are EBCDIC, so they can be viewed on the i, but not on the PC.

You need to first create the file and mark it with 819. Then close it. Then open it again with O_TEXTDATA to tell the system to translate it. That way, when you write data, it ends up in ASCII.

It'll still be readable from the i -- the i will see the codepage of 819 and will translate as needed. But, Windows doesn't understand the idea of "marking a file with a codepage", so it'll only understand it if it's already in ASCII.

If you're on V5R2 or later, you can use O_TEXT_CREAT to eliminate the need for two calls to open. If you're on V5R1 or later, I suggest using O_CCSID instead of O_CODEPAGE because O_CCSID has more functionality (although, you don't need it today, you might need it later)

So to create and translate on V3R2-V4R5:

unlink(filename);
fd = open( filename
: O_CREAT+O_CODEPAGE+O_WRONLY
: mode
: 819 );
rc = close(fd);

fd = open( filename
: O_WRONLY+O_TEXTDATA+O_CODEPAGE
: 0
: 0);

in V5R1:
same thing, but use O_CCSID instead of O_CODEPAGE.

in V5R2 and later:

unlink(filename);
fd = open( filename
: O_CREAT+O_CCSID+O_WRONLY+O_TEXTDATA
+O_TEXT_CREAT
: mode
: 819
: 0 );

Hope that makes sense.

Also, keep in mind that 819 is iso-8859-1. Assuming that's the encoding you want your your XML, that's good. If you want UTF-8, though, use CCSID 1208 instead. (UTF-8 requires a CCSID, not a codepage).



Lowary, Jim wrote:
I'm using Scott's routines (Many Thanks, Scott!) to write an XML file to
the IFS and using codepage 819. Now the data is displayable using green
screen via WRKLNK and if I do properties on that STMF it show a CodePage
of 819; but if I use the iSeries navigator and drag it to my desktop it
is gibberish.
I was thinking that would be the other way around, that with CodePage
819 it wouldn't be readable on the iSeries but would on the PC.

I've even tried using CodePage 37 and get the same results.

There is obviously something I'm missing our don't understand (this is
an understatement at this point!)

Thanks,
-- Jim Lowary



As an Amazon Associate we earn from qualifying purchases.

This thread ...

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.