From who's perspective does the data appear to be "scrambled eggs"? The original Cyrillic user or someone else? If someone else, how is their display device and job configured?
How is the data encoded in DHL007132? What type of file is this?
Wim_Vandepoel@xxxxxxx wrote:
Hi All
I know this has been discussed before, but I have no clue....
So here I go;
We have users with Client Access Cyrillic fonts installed and sessions
with ccsid 1025.
They key in Russian data which looks nice on their pc, with their
settings. (it looks likes random special characters to us)
When I create a .txt file in the IFS (enabling translation ccsid=1025) the
data is still scrambled eggs.
I must be overlooking something obvious....
We have a VB workaround which creates a .txt file with encoding=unicode
and ccsid 1025.
But I just don't like the detour.
Does anyone have any suggestions?
Thanks in advance &
Have a Nice day
Wim
/free
*inlr = *on ;
// Retrieve string YYYYMMDDHHMMSS from current timestamp
aTimeStamp = %subst(%char(%timestamp:*iso0):1:14) ;
// Create txt file name
aFileName = 'Cyril_' + aTimeStamp + '.txt' ;
// Change directory ...
if chdir('/tmp') < 0 ;
ErrMsg = %str(strerror(errno)) ;
Return ;
endif ;
// Set flag & mode parameters ...
Flags = O_CREAT + O_EXCL + O_RDWR + O_CCSID ;
Mode = S_IRUSR + S_IWUSR + S_IXUSR +
S_IRGRP + S_IWGRP + S_IXGRP +
S_IROTH + S_IWOTH + S_IXOTH ;
// Create the file, with CCSID 1025
fd = open( %trimr(aFileName)
: Flags
: Mode
: 1025 ) ;
// Close the file
closef(fd) ;
// Open the file again (enable translation)
fd = open( %trimr(aFileName) : O_RDWR + O_TEXTDATA ) ;
// Get data
dou %eof(DHL007132) ;
read DHL007132 ;
if %eof(DHL007132) ;
Leave ;
endif ;
aData = %trim(DETL006) + crlf ;
// Write data to stream file ...
if write(fd: %addr(aData): %len(%trimr(aData))) < 1 ;
ErrMsg = %str(strerror(errno)) ;
endif ;
Enddo ;
// Close the file ...
closef(fd) ;
// End Program
return ;
/end-free
As an Amazon Associate we earn from qualifying purchases.