Padding NULL to string

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
ds2000
Premium Member
Premium Member
Posts: 109
Joined: Sun Apr 22, 2007 7:25 pm
Location: ny

Padding NULL to string

Post by ds2000 »

While creating a sequential file strings are padded with NULLs. I want to remove those nulls before loading to table.

Although its for parallel jobs but i tried to set following property as well but it didnt work: APT_STRING_PADCHAR 32x0
girija
Participant
Posts: 89
Joined: Fri Mar 24, 2006 1:51 pm
Location: Hartford

Post by girija »

Hi,
As per my knowledge, you can't write NULL in sequential file. I think you mean trimmed values stored in sequential file and you want to pad spaces when you load into oracle table. If so try with field type as char with proper length and define APT_STRING_PAD_CHAR as 0x20.
ds2000
Premium Member
Premium Member
Posts: 109
Joined: Sun Apr 22, 2007 7:25 pm
Location: ny

Post by ds2000 »

APT_STRING_PAD_CHAR is not Parallel property?
Can it be used used in server job as well ?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

APT_STRING_PADCHAR is for parallel jobs only. Use Convert() to remove any Char(0) values, and Fmt() to generate space padding. For example, if the output field is 15 characters wide

Code: Select all

Fmt(Convert(Char(0)," ",InLink.ColName),"15L")
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