Re: Issues with code page conversion..grateful for any help

Daniel Gross <[email protected]> Tue, 31 Mar 2026 17:57:00 +0200
Newsgroups gmane.comp.lang.as400.rpg
Message-ID <[email protected]>
Correct - IFS_WRITE assumes the job CSSID - my fault.

So one solution might be:

dcl-s char273 varchar(100) ccsid(273) inz('Zakªad');
dcl-s char870 varchar(100) ccsid(870) inz;
dcl-s charUTF varchar(100) ccsid(*UTF8) inz;

char870 = char273;
charUTF = char870;

exec sql                         
CALL QSYS2.IFS_WRITE_UTF8(            
PATH_NAME => trim(:Path),        
LINE => :charUTF,                      
END_OF_LINE => 'NONE',           
FILE_CCSID => 1208,      
OVERWRITE => 'REPLACE');

HTH
Daniel


> Am 31.03.2026 um 17:47 schrieb cesco via RPG400-L <[email protected]>:
> 
> If your "line" variable is already 1208 try to use IFS_WRITE_UTF8
> IFS_WRITE normally expect job ccsid in the var.
> 
> Also check the ccsid of the target file if preexisting (via wrklnk).
> I have in my db also polish, it is handled fine (I use UTF16 in db but is irrelevant here).
> 
> 
> 
> 
> 
> 
> 
> 
> On Monday, March 30, 2026 at 07:01:36 PM GMT+2, [email protected] <[email protected]> wrote:
> 
> 
> 
> 
> 
> Hello all,
> 
> 
> 
> I am using “QSYS2.IFS_WRITE_UTF8” to generate a UTF8 Output file.
> 
> 
> 
> So far so good … I have data with Polish special characters that must be sent with correct CCSID (870)
> 
> 
> 
> I use
> 
> 
> 
> EXEC SQL SET :chr870 = CAST(:myData AS CHAR(100) CCSID 870) to convert my data to CCSID 870 but when I write
> 
> To my output file the special characters are not written correctly.
> 
> 
> 
> Any ides on how to write these special characters to UTF8 without losing the code page …
> 
> I have tried a few things but no success yet… I am hoping the CCSID guru’s out there have a few ideas for me.
> 
> 
> 
> 
> 
> Mit freundlichen Grüßen / Kind regards / Bien à vous,
> 
> 
> 
> Sean
> 
> 
> 
> --
> This is the RPG programming on IBM i (RPG400-L) mailing list
> To post a message email: [email protected]
> To subscribe, unsubscribe, or change list options,
> visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
> or email: [email protected]
> Before posting, please take a moment to review the archives
> at https://archive.midrange.com/rpg400-l.
> 
> Please contact [email protected] for any subscription related questions.
> 
> --
> This is the RPG programming on IBM i (RPG400-L) mailing list
> To post a message email: [email protected]
> To subscribe, unsubscribe, or change list options,
> visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
> or email: [email protected]
> Before posting, please take a moment to review the archives
> at https://archive.midrange.com/rpg400-l.
> 
> Please contact [email protected] for any subscription related questions.
> 
-- 
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: [email protected]
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: [email protected]
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact [email protected] for any subscription related questions.