Page 1 of 1

Fixed width file creation problem when using NLS UTF-16BE..

Posted: Fri Feb 09, 2007 11:24 am
by ram1899
We are extracting data from SAP IDOC extract and creating fixed width file with NLS UTF 16BE. It is not actually creating a fixed width file all the space are trimmed.
My output file has three columns
Col1 Char(08 ) sample value IBMC expecting length(08 )
Col2 Char(20) sample value CUS56UT expecting length(20)
Col3 Char(16) sample value 99991231 excepting length(16)
all three columns uses extended property to unicode.

here is the actual output i get.
IBMCUS56UT 99991231
IBMCUS56UT 99991231

any help is highly appreciated.Thank you

Posted: Fri Feb 09, 2007 3:44 pm
by ray.wurlod
The Char columns are padded with 0x00 (ASCII NUL), not with 0x20 (ASCII space). You can see this by viewing the output with a hex editor, such as UltraEdit.

You can change this behaviour by setting the value of environment variable APT_STRING_PADCHAR to 0x20.

The reason the data don't seem to be fixed length is that the C program (the data browser, for example) interprets 0x00 as "end of string".