Page 1 of 1

Column for Null values Missing...

Posted: Wed Feb 22, 2012 1:03 pm
by srinath51
Hi All,

My path is as Following :

DataSet(the Dataset Comes from an Extract Job) =====> Transformer =====> Seq File

i am generating a sample text file,i have Four columns in the file i.e; SEQ,REC,TXN,STP & there are total of 11 Rows.

the Column "TXN" has Null Values for 3 rows,so i am using this in the transformer logic :
If IsNull( READ_Data.OWSC32_TXN) Then Space(5) Else READ_Data.OWSC32_TXN

so finally when i run and see the Output file Why the column 4 "STP" is missing for the 3 rows that has Null values for "TXN"

the three columns are being concatenated into a single column....

Please help me out....

Re: Column for Null values Missing...

Posted: Wed Feb 22, 2012 1:14 pm
by Developer9

Code: Select all

DataSet(the Dataset Comes from an Extract Job) =====> Transformer =====> Seq File
Hi,

Please make sure your mapping is proper ..

you can always check your transformation logic by writing it to PEEK stage

Code: Select all

source >>xfm (apply transformation logic for the field)>>peek stage
This way you can get more clear picture about "particular column"..

Thank you

Re: Column for Null values Missing...

Posted: Wed Feb 22, 2012 1:21 pm
by srinath51
Hi ,

i used the peek stage and still i am not able to get the Column 4 - 'STP' populated.

Re: Column for Null values Missing...

Posted: Wed Feb 22, 2012 1:55 pm
by Developer9
Hi,

Can you able to "view data "for the "Column 4 - 'STP' "..?? do a "mapping as-is .i.e..straight mapping "

There shouldn't be any problem ..

Thank you

Posted: Wed Feb 22, 2012 2:22 pm
by srinath51
Hi,

when i do the mapping 1-1,i can view the data.in fact the data for the Column 3 -TXN is 'Null' for 3 rows and remaining 8 rows there are values for that Column.

But when i concatenate then why i am not able to see the Column 4 - STP for txn ===>Null,But i can see the Col 4 for the remaining 8 rows...?

Posted: Wed Feb 22, 2012 3:01 pm
by ray.wurlod
No operation is permitted on NULL. You can't do arithmetic, you can't concatenate. All you can do is test for whether or not a value is NULL (or is not NULL).

Posted: Wed Feb 22, 2012 3:12 pm
by Developer9
Hi ,

Still I am trying to understood your problem :)
why i am not able to see the Column 4 - STP for txn ===>Null,
Let me try this way:

Out put data :

Code: Select all

             col1,col2,col3,col4
row1..3      a,b,c,-
row4...11.   n,m,d,g
This can happen ..means "no value" for col4 for "3 rows".."value is different from column "..

Thank you

Posted: Wed Feb 22, 2012 8:33 pm
by qt_ky
ray.wurlod wrote:No operation is permitted on NULL.
You can do NULL arithmetic and concatenations but the result will always be NULL, so there is not much use.

That appears to be what's happening here in the original post. Concatenating anything with NULL results in NULL.

Perhaps one of the other columns, such as column 4 "STP," contains NULLs that also need to be handled.

Posted: Thu Feb 23, 2012 8:56 am
by srinath51
Ok,i will check any null values for the Col 4 - 'STP'