Page 1 of 1

Empty string Handling in Datastage

Posted: Tue Jun 03, 2008 3:53 pm
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

Posted: Tue Jun 03, 2008 4:05 pm
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

Posted: Tue Jun 03, 2008 4:29 pm
by 199542
Thank you very much ray ....It worked....