It sounds like your code page setting is causing some issues. 
I had the same problem before. 
To get around it, I did the following: 
 fd=unlink(%trim(filename));                            
 flags=O_RDWR+O_CREAT+O_TRUNC+O_TEXTDATA+O_CODEPAGE;    
 mode=S_IRWXU+S_IRWXG+S_IROTH+S_IXOTH;                  
 codepage=819;  // 437                                  
 fd=open(%trim(filename):flags:mode:codepage);          
 callp close(fd);                                       
 flags=O_RDWR+O_TEXTDATA;                               
 fd=open(%trim(filename):flags);                        
This seemed to get me around the issue with garbage in the file. (The idea came from something someone else mentioned somewhere along the line..) 
Jay 
----- Original Message -----
From: "John Allen" <jallen@xxxxxxxxxxx> 
To: RPG400-L@xxxxxxxxxxxx 
Sent: Thursday, May 31, 2012 12:19:37 PM 
Subject: Attempting to write to IFS andmissing turkish characters 
I am attempting to write/create a txt file directly into the IFS the file contains Turkish characters 
  
I have a copy of Scotts great and very helpful IFS eBook (Thank you very much Scott) 
  
This file contains turkish characters such as ÜŞ 
It appears using code 1026 these characters are Hex 7F and Hex 7C 
  
For my test I did the following: 
1)      Modified Scotts program CH5ASCII that creates and writes some simple text to a text file 
2)      Changed the code that creates a new file to specify code page 1026 rather than 819 
3)      Output some text including a Hex 7F7C 
  
Runs fine, but when the file is opened from the 400 (EDTF) I see a “@  I was expecting to see ÜŞ 
When I open it with Notepad I see jibberish Ä…™@Ö¤¢‰•k%%É@“–¥…@£ˆ…@¦ 
  
Obviously there is something I am missing 
  
Anybody know what I am doing wrong? 
  
Thanks 
  
John 
  
  
  
  
  _____   
I am using the Free version of SPAMfighter <
http://www.spamfighter.com/len> . 
SPAMfighter has removed 3429 of my spam emails to date. 
Do you have a slow PC? <
http://www.spamfighter.com/SLOW-PCfighter?cid=sigen>  Try free scan! 
 
As an Amazon Associate we earn from qualifying purchases.