Sripping Null Char in DB2

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
ssbhas
Premium Member
Premium Member
Posts: 8
Joined: Thu Jul 21, 2005 11:02 pm

Sripping Null Char in DB2

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

Post by ray.wurlod »

DataStage.

Code: Select all

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

Code: Select all

tr '\0' ' ' < infile > outfile
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ssbhas
Premium Member
Premium Member
Posts: 8
Joined: Thu Jul 21, 2005 11:02 pm

Post by ssbhas »

Thanks Ray. It worked.
Post Reply