Hi,
I have a PF with several fields. One field is defined as 140G CCSID(13488).
Now I want to write data in a txt-file in the IFS. I've already done this with other programs via IFS API, but I don't know how to do this with the UCS2-Field.
In the program I have a DS with likerec to the PF which get filled with a chain.
I found this article http://iprodeveloper.com/rpg-program...nicode-ifs-rpg
According to the post of Scott I opened a file with O_CREAT+O_WRONLY+O_CCSID+O_TEXTDATA and CP_UCS2 (CCSID 1200) and then wrote the data with write(fd: %addr(data): %len(%trimr(data))*2) where data is the field from the likerec-DS with CCSID(13488).
But the output in the file is not correct.
Latin-Text is formatted with spaces. E.G. "Test" is written as " T e s t".
Kyrillian-Text is unreadable.
Also with CCSID 13488 for the txt-file there is no difference.
Where is the error?
I have a PF with several fields. One field is defined as 140G CCSID(13488).
Now I want to write data in a txt-file in the IFS. I've already done this with other programs via IFS API, but I don't know how to do this with the UCS2-Field.
In the program I have a DS with likerec to the PF which get filled with a chain.
I found this article http://iprodeveloper.com/rpg-program...nicode-ifs-rpg
According to the post of Scott I opened a file with O_CREAT+O_WRONLY+O_CCSID+O_TEXTDATA and CP_UCS2 (CCSID 1200) and then wrote the data with write(fd: %addr(data): %len(%trimr(data))*2) where data is the field from the likerec-DS with CCSID(13488).
But the output in the file is not correct.
Latin-Text is formatted with spaces. E.G. "Test" is written as " T e s t".
Kyrillian-Text is unreadable.
Also with CCSID 13488 for the txt-file there is no difference.
Where is the error?
Comment