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

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
ram1899
Charter Member
Charter Member
Posts: 41
Joined: Wed Aug 04, 2004 11:46 am

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

Post 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
ram1899
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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".
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply