Hi Darren,
Do a "dspsysval qccsid" to see what your CCSID is. I believe the default is 65535. We changed our system to use 37. The problem with 65535 is that it doesn't allow translation to a non-i system (there's probably a better way of saying it).
From this document:
https://www-304.ibm.com/support/docview.wss?uid=nas1424b54dc5ddb1790862565c2007cc019
"When transferring data across platforms, the CCSID is used to determine how the data is handled during the transfer. US English uses 037, Multilingual is 500, but 65535 by definition implies that there is no character set associated with binary data."
I hope this helps,
Kurt Anderson
-----Original Message-----
From: rpg400-l-bounces+kurt.anderson=customcall.com@xxxxxxxxxxxx [mailto:rpg400-l-bounces+kurt.anderson=customcall.com@xxxxxxxxxxxx] On Behalf Of darren@xxxxxxxxx
Sent: Friday, October 07, 2011 3:11 PM
To: midrange-RPG RPG message board
Subject: SQL to IFS wrong CCSID
I'm trying an example of some code I saw, which writes a message to an IFS directory. It works great when looking at the file from the i, but if I open it with a Windows program, such as Notepad, it looks like garbage...indicating that I have a character set issue. Is there a way to have this file written in a PC character set? I notice that if I create the file through windows, in the IFS, that the program replaces the file with the correct character set, and I can read what it writes in Windows.
H ActGrp(*CALLER) DftActGrp(*NO) ExprOpts(*RESDECPOS) DatFmt(*USA)
H OPTION(*SRCSTMT:*NODEBUGIO) EXTBININT(*YES)
//
D Doc S SQLTYPE(CLOB_FILE)
D CRLF S 2 INZ(X'0D25')
//****************************************************************
// Begin Calculation Specifications
//****************************************************************
/FREE
clear Doc;
Doc_Name='/tmp/TEST.txt';
Doc_NL=%len(%trim(Doc_Name));
Doc_FO=SQFOVR;
exec sql set :Doc='This is test record 1';
*InLR = *On;
Return;
--
This is the RPG programming on the IBM i / System i (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.
As an Amazon Associate we earn from qualifying purchases.