Page 1 of 1

Sripping Null Char in DB2

Posted: Wed Jul 25, 2007 12:14 pm
by ssbhas
Hi all,

The APT_STRING_PADCHAR has been initially set to 0x00 and when data is loaded to DB2, DB2EE stage has padded weird boxes for each Char field.

Image

We have changed the value to 0x20. But we need to correct existing data. Can any one of you suggest an option (may be SQL or DataStage) to trim these the charecters without reprocessing data.

Posted: Wed Jul 25, 2007 11:48 pm
by ray.wurlod
DataStage.

Code: Select all

Convert(Char(0), " ", InLink.TheString)
UNIX

Code: Select all

tr '\0' ' ' < infile > outfile

Posted: Thu Jul 26, 2007 2:56 pm
by ssbhas
Thanks Ray. It worked.