Empty string Handling in Datastage

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
199542
Participant
Posts: 41
Joined: Sat Dec 29, 2007 2:42 am

Empty string Handling in Datastage

Post by 199542 »

Hi everyone ,
I am using DATASTAGE 8.0.1 version on LINUX box.I am facing following problem :

I have a job with below design

seq ---->>> transformer -----> oracle enterprise stage

I have a NUMBER field in the input sequential file .I am reading it as integer.But when i am getting data as an empty string ( ' ' its length is 3 ) ,that record is getting rejected.

My first question : Is there any way to read all the records even though there are some records with emptystring in it .

As a part of work around , I am reading it as char .But in target its datatype is NUMBER(3,0).So , When i am running the job the empty string is loaded as 0 .I want this to be loaded as NULL.

So , Request you to suggest so that i can proceed further

Thank you all in advance
gikjpjj
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Read as Char or VarChar. In the Transformer stage test for an all-blank value and replace that with null.

Code: Select all

If InLink.TheNumber = "   " Then SetNull() Else InLink.TheNumber
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
199542
Participant
Posts: 41
Joined: Sat Dec 29, 2007 2:42 am

Post by 199542 »

Thank you very much ray ....It worked....
gikjpjj
Post Reply